{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using backend: pytorch\n",
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/dgl/base.py:45: DGLWarning: Detected an old version of PyTorch. Suggest using torch>=1.5.0 for the best experience.\n",
      "  return warnings.warn(message, category=category, stacklevel=1)\n"
     ]
    }
   ],
   "source": [
    "from CRST import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "load len:  100\n",
      "load len:  4581\n",
      "load len:  1121\n"
     ]
    }
   ],
   "source": [
    "    BiGCN1_Paths = [\"../../saved/TFIDF_BiGCNCharliehebdo_0.81.pkl\",\n",
    "                   \"../../saved/TFIDF_BiGCN_ferguson_0.68.pkl\",\n",
    "                   \"../../saved/TFIDF_BiGCN_germanwings-crash_0.70.pkl\",\n",
    "                   \"../../saved/TFIDF_BiGCN_ottawashooting_0.68.pkl\",\n",
    "                   \"../../saved/TFIDF_BiGCN_sydneysiege_0.67.pkl\"\n",
    "                   ]\n",
    "\n",
    "    BiGCN2_Paths = [\"../../saved/TFIDF_BiGCNCharliehebdo_0.80.pkl\",\n",
    "                   \"../../saved/TFIDF_BiGCN_ferguson_0.71.pkl\",\n",
    "                   \"../../saved/TFIDF_BiGCN_germanwings-crash_0.68.pkl\",\n",
    "                   \"../../saved/TFIDF_BiGCN_ottawashooting_0.70.pkl\",\n",
    "                   \"../../saved/TFIDF_BiGCN_sydneysiege_0.66.pkl\"\n",
    "                   ]\n",
    "\n",
    "    domainID = 4\n",
    "    fewShotCnt = 100\n",
    "    fewShotSet, oldDomain, newDomain = obtain_Domain_set(\n",
    "        f\"../../data/twitter_fs{domainID}_{fewShotCnt}\",\n",
    "        f\"../../data/twitter_od{domainID}_{fewShotCnt}\",\n",
    "        f\"../../data/twitter_nd{domainID}_{fewShotCnt}\"\n",
    "    )\n",
    "\n",
    "    newDomainName = newDomain.data[newDomain.data_ID[0]]['event']\n",
    "    logDir = \"MetaSelfTrain_0\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "    trainer = CRST_LRENT(  logDir,\n",
    "                           \"{}_{}\".format(logDir, newDomainName),\n",
    "                           \"{}/model_{}.pth\".format(logDir, newDomainName),\n",
    "                           class_num=2 \n",
    "                        )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "self.embedding.weight.requires_grad False\n",
      "requires_grad = False\n",
      "OOV Count: 9570\n",
      "OOV Ratio: 0.25373173900363233\n",
      "fewShotSet/newDomain/oldDomain = 100/1121/4581\n"
     ]
    }
   ],
   "source": [
    "    Tf_IdfTwitterFile = \"../../saved/TfIdf_twitter.pkl\"\n",
    "    if os.path.exists(Tf_IdfTwitterFile):\n",
    "        with open(Tf_IdfTwitterFile, \"rb\") as fr:\n",
    "            tv = pickle.load(fr)\n",
    "    else:\n",
    "        lemma = Lemma_Factory()\n",
    "        corpus = [\" \".join(lemma(txt)) for data in [fewShotSet, oldDomain, newDomain]\n",
    "                  for ID in data.data_ID for txt in data.data[ID]['text']]\n",
    "        tv = TfidfVectorizer(use_idf=True, smooth_idf=True, norm=None)\n",
    "        _ = tv.fit_transform(corpus)\n",
    "        with open(Tf_IdfTwitterFile, \"wb\") as fw:\n",
    "            pickle.dump(tv, fw, protocol=pickle.HIGHEST_PROTOCOL)\n",
    "    model1 = obtain_model(tv)\n",
    "    model1.load_model(BiGCN2_Paths[domainID])\n",
    "\n",
    "    pseaudoIdxs = []\n",
    "    expandSetIdxs = []\n",
    "    unlabeledSet = newDomain\n",
    "\n",
    "    train_it = 0\n",
    "    print(f\"fewShotSet/newDomain/oldDomain = {len(fewShotSet)}/{len(newDomain)}/{len(oldDomain)}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "U_label = torch.tensor(unlabeledSet.data_y).argmax(dim=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:26<00:00,  2.14it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "adversarial_aug\n",
      "####Model Update#### step=0 (0 | 1) ####, loss = 0.28595060110092163\n",
      "gaussian_aug\n",
      "####Model Update#### step=1 (0 | 1) ####, loss = 0.13600818812847137\n",
      "randomReplace\n",
      "####Model Update#### step=2 (0 | 1) ####, loss = 0.41041406989097595\n",
      "gaussian_blur\n",
      "####Model Update#### step=3 (0 | 1) ####, loss = 0.36729875206947327\n",
      "randomReplace\n",
      "####Model Update#### step=4 (0 | 1) ####, loss = 0.2577160596847534\n",
      "gaussian_blur\n",
      "####Model Update#### step=5 (0 | 1) ####, loss = 0.2957628667354584\n",
      "gaussian_blur\n",
      "####Model Update#### step=6 (0 | 1) ####, loss = 0.3208000361919403\n",
      "randomReplace\n",
      "####Model Update#### step=7 (0 | 1) ####, loss = 0.3374154567718506\n",
      "randomMask\n",
      "####Model Update#### step=8 (0 | 1) ####, loss = 0.12736937403678894\n",
      "adversarial_aug\n",
      "####Model Update#### step=9 (0 | 1) ####, loss = 0.12162163853645325\n",
      "gaussian_aug\n",
      "####Model Update#### step=10 (0 | 1) ####, loss = 0.21039295196533203\n",
      "gaussian_aug\n",
      "####Model Update#### step=11 (0 | 1) ####, loss = 0.2311038225889206\n",
      "gaussian_blur\n",
      "####Model Update#### step=12 (0 | 1) ####, loss = 0.29637056589126587\n",
      "randomMask\n",
      "####Model Update#### step=13 (0 | 1) ####, loss = 0.0951579138636589\n",
      "adversarial_aug\n",
      "####Model Update#### step=14 (0 | 1) ####, loss = 0.222939133644104\n",
      "gaussian_aug\n",
      "####Model Update#### step=15 (0 | 1) ####, loss = 0.08875946700572968\n",
      "randomReplace\n",
      "####Model Update#### step=16 (0 | 1) ####, loss = 0.10027088224887848\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  2%|▏         | 1/57 [00:00<00:06,  8.99it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gaussian_aug\n",
      "####Model Update#### step=17 (0 | 1) ####, loss = 0.05794805660843849\n",
      "========> mean loss: 0.22018332427574527\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:06<00:00,  8.65it/s]\n",
      "  2%|▏         | 1/57 [00:00<00:06,  8.88it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "step = 0 :  (0.7457627118644068, (array([0.81271478, 0.67346939]), array([0.72881356, 0.7690678 ]), array([0.76848091, 0.71810089]), array([649, 472])))\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:06<00:00,  8.55it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gaussian_blur\n",
      "####Model Update#### step=0 (0 | 1) ####, loss = 0.21027804911136627\n",
      "gaussian_aug\n",
      "####Model Update#### step=1 (0 | 1) ####, loss = 0.09954054653644562\n",
      "gaussian_aug\n",
      "####Model Update#### step=2 (0 | 1) ####, loss = 0.08685915172100067\n",
      "gaussian_blur\n",
      "####Model Update#### step=3 (0 | 1) ####, loss = 0.15062271058559418\n",
      "gaussian_blur\n",
      "####Model Update#### step=4 (0 | 1) ####, loss = 0.14879366755485535\n",
      "randomMask\n",
      "####Model Update#### step=5 (0 | 1) ####, loss = 0.12871353328227997\n",
      "gaussian_blur\n",
      "####Model Update#### step=6 (0 | 1) ####, loss = 0.07885004580020905\n",
      "gaussian_blur\n",
      "####Model Update#### step=7 (0 | 1) ####, loss = 0.08568844944238663\n",
      "randomMask\n",
      "####Model Update#### step=8 (0 | 1) ####, loss = 0.3439093232154846\n",
      "gaussian_aug\n",
      "####Model Update#### step=9 (0 | 1) ####, loss = 0.007949158549308777\n",
      "adversarial_aug\n",
      "####Model Update#### step=10 (0 | 1) ####, loss = 0.030810624361038208\n",
      "gaussian_blur\n",
      "####Model Update#### step=11 (0 | 1) ####, loss = 0.19971708953380585\n",
      "adversarial_aug\n",
      "####Model Update#### step=12 (0 | 1) ####, loss = 0.3615356683731079\n",
      "randomReplace\n",
      "####Model Update#### step=13 (0 | 1) ####, loss = 0.38017287850379944\n",
      "randomReplace\n",
      "####Model Update#### step=14 (0 | 1) ####, loss = 0.054562076926231384\n",
      "gaussian_aug\n",
      "####Model Update#### step=15 (0 | 1) ####, loss = 0.2043442726135254\n",
      "adversarial_aug\n",
      "####Model Update#### step=16 (0 | 1) ####, loss = 0.06318656355142593\n",
      "gaussian_aug\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  2%|▏         | 1/57 [00:00<00:06,  8.45it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Model Update#### step=17 (0 | 1) ####, loss = 0.08548128604888916\n",
      "========> mean loss: 0.15116750531726414\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:06<00:00,  8.16it/s]\n",
      "  2%|▏         | 1/57 [00:00<00:05,  9.46it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "step = 0 :  (0.768064228367529, (array([0.80824089, 0.71632653]), array([0.78582435, 0.74364407]), array([0.796875  , 0.72972973]), array([649, 472])))\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:06<00:00,  8.30it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gaussian_blur\n",
      "####Model Update#### step=0 (0 | 1) ####, loss = 0.08011360466480255\n",
      "randomReplace\n",
      "####Model Update#### step=1 (0 | 1) ####, loss = 0.121921107172966\n",
      "randomReplace\n",
      "####Model Update#### step=2 (0 | 1) ####, loss = 0.1271788626909256\n",
      "randomMask\n",
      "####Model Update#### step=3 (0 | 1) ####, loss = 0.014478914439678192\n",
      "randomMask\n",
      "####Model Update#### step=4 (0 | 1) ####, loss = 0.05348080024123192\n",
      "randomMask\n",
      "####Model Update#### step=5 (0 | 1) ####, loss = 0.13865044713020325\n",
      "gaussian_aug\n",
      "####Model Update#### step=6 (0 | 1) ####, loss = 0.029416464269161224\n",
      "gaussian_blur\n",
      "####Model Update#### step=7 (0 | 1) ####, loss = 0.04584639519453049\n",
      "adversarial_aug\n",
      "####Model Update#### step=8 (0 | 1) ####, loss = 0.19989052414894104\n",
      "adversarial_aug\n",
      "####Model Update#### step=9 (0 | 1) ####, loss = 0.043465130031108856\n",
      "adversarial_aug\n",
      "####Model Update#### step=10 (0 | 1) ####, loss = 0.3039487600326538\n",
      "randomMask\n",
      "####Model Update#### step=11 (0 | 1) ####, loss = 0.07908935844898224\n",
      "gaussian_blur\n",
      "####Model Update#### step=12 (0 | 1) ####, loss = 0.04561689496040344\n",
      "randomReplace\n",
      "####Model Update#### step=13 (0 | 1) ####, loss = 0.00888020545244217\n",
      "randomReplace\n",
      "####Model Update#### step=14 (0 | 1) ####, loss = 0.23655760288238525\n",
      "randomMask\n",
      "####Model Update#### step=15 (0 | 1) ####, loss = 0.17476029694080353\n",
      "randomReplace\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\r",
      "  0%|          | 0/57 [00:00<?, ?it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Model Update#### step=16 (0 | 1) ####, loss = 0.2610933184623718\n",
      "gaussian_blur\n",
      "####Model Update#### step=17 (0 | 1) ####, loss = 0.025723084807395935\n",
      "========> mean loss: 0.11056176510949929\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:06<00:00,  8.33it/s]\n",
      "  2%|▏         | 1/57 [00:00<00:06,  8.12it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "step = 0 :  (0.7832292595896521, (array([0.82120253, 0.73415133]), array([0.79969183, 0.76059322]), array([0.81030445, 0.7471384 ]), array([649, 472])))\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:07<00:00,  7.83it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gaussian_aug\n",
      "####Model Update#### step=0 (0 | 1) ####, loss = 0.0035466470289975405\n",
      "gaussian_blur\n",
      "####Model Update#### step=1 (0 | 1) ####, loss = 0.13725818693637848\n",
      "randomReplace\n",
      "####Model Update#### step=2 (0 | 1) ####, loss = 0.1065874844789505\n",
      "gaussian_blur\n",
      "####Model Update#### step=3 (0 | 1) ####, loss = 0.018262822180986404\n",
      "adversarial_aug\n",
      "####Model Update#### step=4 (0 | 1) ####, loss = 0.008749878033995628\n",
      "gaussian_blur\n",
      "####Model Update#### step=5 (0 | 1) ####, loss = 0.038620054721832275\n",
      "adversarial_aug\n",
      "####Model Update#### step=6 (0 | 1) ####, loss = 0.14222155511379242\n",
      "adversarial_aug\n",
      "####Model Update#### step=7 (0 | 1) ####, loss = 0.13810941576957703\n",
      "randomReplace\n",
      "####Model Update#### step=8 (0 | 1) ####, loss = 0.4137830138206482\n",
      "randomReplace\n",
      "####Model Update#### step=9 (0 | 1) ####, loss = 0.1658821552991867\n",
      "gaussian_blur\n",
      "####Model Update#### step=10 (0 | 1) ####, loss = 0.07110230624675751\n",
      "adversarial_aug\n",
      "####Model Update#### step=11 (0 | 1) ####, loss = 0.0506238117814064\n",
      "gaussian_aug\n",
      "####Model Update#### step=12 (0 | 1) ####, loss = 0.009384260512888432\n",
      "gaussian_aug\n",
      "####Model Update#### step=13 (0 | 1) ####, loss = 0.11620132625102997\n",
      "randomMask\n",
      "####Model Update#### step=14 (0 | 1) ####, loss = 0.026566021144390106\n",
      "gaussian_aug\n",
      "####Model Update#### step=15 (0 | 1) ####, loss = 0.010056531056761742\n",
      "adversarial_aug\n",
      "####Model Update#### step=16 (0 | 1) ####, loss = 0.07587788999080658\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\r",
      "  0%|          | 0/57 [00:00<?, ?it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "randomReplace\n",
      "####Model Update#### step=17 (0 | 1) ####, loss = 0.050406526774168015\n",
      "========> mean loss: 0.08795777150791967\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:06<00:00,  8.35it/s]\n",
      "  2%|▏         | 1/57 [00:00<00:06,  9.09it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "step = 0 :  (0.7707404103479036, (array([0.78242075, 0.75175644]), array([0.8366718 , 0.68008475]), array([0.80863738, 0.71412681]), array([649, 472])))\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:08<00:00,  6.59it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gaussian_blur\n",
      "####Model Update#### step=0 (0 | 1) ####, loss = 0.050335124135017395\n",
      "randomMask\n",
      "####Model Update#### step=1 (0 | 1) ####, loss = 0.03191184997558594\n",
      "randomReplace\n",
      "####Model Update#### step=2 (0 | 1) ####, loss = 0.2007266879081726\n",
      "gaussian_aug\n",
      "####Model Update#### step=3 (0 | 1) ####, loss = 0.001572516979649663\n",
      "gaussian_aug\n",
      "####Model Update#### step=4 (0 | 1) ####, loss = 0.08517713099718094\n",
      "randomMask\n",
      "####Model Update#### step=5 (0 | 1) ####, loss = 0.02559003420174122\n",
      "gaussian_blur\n",
      "####Model Update#### step=6 (0 | 1) ####, loss = 0.06613849103450775\n",
      "randomMask\n",
      "####Model Update#### step=7 (0 | 1) ####, loss = 0.06695723533630371\n",
      "randomMask\n",
      "####Model Update#### step=8 (0 | 1) ####, loss = 0.010342467576265335\n",
      "randomMask\n",
      "####Model Update#### step=9 (0 | 1) ####, loss = 0.10048940777778625\n",
      "gaussian_aug\n",
      "####Model Update#### step=10 (0 | 1) ####, loss = 0.05561105161905289\n",
      "adversarial_aug\n",
      "####Model Update#### step=11 (0 | 1) ####, loss = 0.06397689133882523\n",
      "randomMask\n",
      "####Model Update#### step=12 (0 | 1) ####, loss = 0.02132950723171234\n",
      "adversarial_aug\n",
      "####Model Update#### step=13 (0 | 1) ####, loss = 0.008503468707203865\n",
      "adversarial_aug\n",
      "####Model Update#### step=14 (0 | 1) ####, loss = 0.10971616953611374\n",
      "gaussian_blur\n",
      "####Model Update#### step=15 (0 | 1) ####, loss = 0.10397931933403015\n",
      "gaussian_aug\n",
      "####Model Update#### step=16 (0 | 1) ####, loss = 0.0032702679745852947\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  2%|▏         | 1/57 [00:00<00:06,  9.27it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gaussian_aug\n",
      "####Model Update#### step=17 (0 | 1) ####, loss = 0.0013257109094411135\n",
      "========> mean loss: 0.05594185180962086\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:06<00:00,  8.26it/s]\n",
      "  2%|▏         | 1/57 [00:00<00:06,  8.91it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "step = 0 :  (0.7885816235504014, (array([0.83333333, 0.73359841]), array([0.79352851, 0.78177966]), array([0.81294396, 0.75692308]), array([649, 472])))\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:07<00:00,  8.01it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "randomReplace\n",
      "####Model Update#### step=0 (0 | 1) ####, loss = 0.36679545044898987\n",
      "randomReplace\n",
      "####Model Update#### step=1 (0 | 1) ####, loss = 0.007152089383453131\n",
      "adversarial_aug\n",
      "####Model Update#### step=2 (0 | 1) ####, loss = 0.03642494976520538\n",
      "randomReplace\n",
      "####Model Update#### step=3 (0 | 1) ####, loss = 0.24905015528202057\n",
      "gaussian_aug\n",
      "####Model Update#### step=4 (0 | 1) ####, loss = 0.01210336945950985\n",
      "adversarial_aug\n",
      "####Model Update#### step=5 (0 | 1) ####, loss = 0.14159704744815826\n",
      "gaussian_aug\n",
      "####Model Update#### step=6 (0 | 1) ####, loss = 0.03295450657606125\n",
      "gaussian_aug\n",
      "####Model Update#### step=7 (0 | 1) ####, loss = 0.28824496269226074\n",
      "gaussian_aug\n",
      "####Model Update#### step=8 (0 | 1) ####, loss = 0.03671809658408165\n",
      "gaussian_blur\n",
      "####Model Update#### step=9 (0 | 1) ####, loss = 0.06248817592859268\n",
      "gaussian_aug\n",
      "####Model Update#### step=10 (0 | 1) ####, loss = 0.0069999732077121735\n",
      "gaussian_blur\n",
      "####Model Update#### step=11 (0 | 1) ####, loss = 0.0050200833939015865\n",
      "adversarial_aug\n",
      "####Model Update#### step=12 (0 | 1) ####, loss = 0.0014151963405311108\n",
      "adversarial_aug\n",
      "####Model Update#### step=13 (0 | 1) ####, loss = 0.020440982654690742\n",
      "adversarial_aug\n",
      "####Model Update#### step=14 (0 | 1) ####, loss = 0.04296460747718811\n",
      "randomMask\n",
      "####Model Update#### step=15 (0 | 1) ####, loss = 0.025115972384810448\n",
      "randomMask\n",
      "####Model Update#### step=16 (0 | 1) ####, loss = 0.006972895935177803\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\r",
      "  0%|          | 0/57 [00:00<?, ?it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "randomMask\n",
      "####Model Update#### step=17 (0 | 1) ####, loss = 0.0787678211927414\n",
      "========> mean loss: 0.0789570186752826\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:07<00:00,  8.12it/s]\n",
      "  2%|▏         | 1/57 [00:00<00:06,  9.03it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "step = 0 :  (0.7743086529884032, (array([0.89442231, 0.67689822]), array([0.69183359, 0.88771186]), array([0.78019114, 0.76810266]), array([649, 472])))\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:06<00:00,  8.53it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "randomMask\n",
      "####Model Update#### step=0 (0 | 1) ####, loss = 0.011837962083518505\n",
      "gaussian_blur\n",
      "####Model Update#### step=1 (0 | 1) ####, loss = 0.03107139840722084\n",
      "adversarial_aug\n",
      "####Model Update#### step=2 (0 | 1) ####, loss = 0.009502961300313473\n",
      "randomReplace\n",
      "####Model Update#### step=3 (0 | 1) ####, loss = 0.04353762045502663\n",
      "gaussian_aug\n",
      "####Model Update#### step=4 (0 | 1) ####, loss = 0.021428566426038742\n",
      "gaussian_aug\n",
      "####Model Update#### step=5 (0 | 1) ####, loss = 0.0034553934819996357\n",
      "gaussian_blur\n",
      "####Model Update#### step=6 (0 | 1) ####, loss = 0.05841657519340515\n",
      "randomMask\n",
      "####Model Update#### step=7 (0 | 1) ####, loss = 0.0010184284765273333\n",
      "gaussian_aug\n",
      "####Model Update#### step=8 (0 | 1) ####, loss = 0.06923191249370575\n",
      "adversarial_aug\n",
      "####Model Update#### step=9 (0 | 1) ####, loss = 0.00032825785456225276\n",
      "adversarial_aug\n",
      "####Model Update#### step=10 (0 | 1) ####, loss = 0.14556708931922913\n",
      "randomMask\n",
      "####Model Update#### step=11 (0 | 1) ####, loss = 0.01049024797976017\n",
      "randomMask\n",
      "####Model Update#### step=12 (0 | 1) ####, loss = 0.06959952414035797\n",
      "gaussian_aug\n",
      "####Model Update#### step=13 (0 | 1) ####, loss = 0.015255085192620754\n",
      "randomReplace\n",
      "####Model Update#### step=14 (0 | 1) ####, loss = 0.004697012715041637\n",
      "adversarial_aug\n",
      "####Model Update#### step=15 (0 | 1) ####, loss = 0.0020506870932877064\n",
      "adversarial_aug\n",
      "####Model Update#### step=16 (0 | 1) ####, loss = 0.0002573913079686463\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  2%|▏         | 1/57 [00:00<00:05,  9.36it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gaussian_aug\n",
      "####Model Update#### step=17 (0 | 1) ####, loss = 0.00039750398718751967\n",
      "========> mean loss: 0.027674645439320657\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:07<00:00,  7.98it/s]\n",
      "  2%|▏         | 1/57 [00:00<00:05,  9.57it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "step = 0 :  (0.7743086529884032, (array([0.88976378, 0.67862969]), array([0.69645609, 0.88135593]), array([0.78133103, 0.76682028]), array([649, 472])))\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:06<00:00,  8.55it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "randomReplace\n",
      "####Model Update#### step=0 (0 | 1) ####, loss = 0.002601425629109144\n",
      "gaussian_blur\n",
      "####Model Update#### step=1 (0 | 1) ####, loss = 0.008245210163295269\n",
      "gaussian_blur\n",
      "####Model Update#### step=2 (0 | 1) ####, loss = 0.0053548142313957214\n",
      "adversarial_aug\n",
      "####Model Update#### step=3 (0 | 1) ####, loss = 0.002201944123953581\n",
      "randomReplace\n",
      "####Model Update#### step=4 (0 | 1) ####, loss = 0.0024694539606571198\n",
      "gaussian_aug\n",
      "####Model Update#### step=5 (0 | 1) ####, loss = 0.00013209451572038233\n",
      "gaussian_blur\n",
      "####Model Update#### step=6 (0 | 1) ####, loss = 0.04122108221054077\n",
      "gaussian_aug\n",
      "####Model Update#### step=7 (0 | 1) ####, loss = 0.01330386009067297\n",
      "gaussian_aug\n",
      "####Model Update#### step=8 (0 | 1) ####, loss = 0.01525906939059496\n",
      "randomMask\n",
      "####Model Update#### step=9 (0 | 1) ####, loss = 0.0033523044548928738\n",
      "randomMask\n",
      "####Model Update#### step=10 (0 | 1) ####, loss = 0.06685585528612137\n",
      "gaussian_blur\n",
      "####Model Update#### step=11 (0 | 1) ####, loss = 0.05434640496969223\n",
      "randomReplace\n",
      "####Model Update#### step=12 (0 | 1) ####, loss = 0.1534775346517563\n",
      "randomReplace\n",
      "####Model Update#### step=13 (0 | 1) ####, loss = 0.010419003665447235\n",
      "adversarial_aug\n",
      "####Model Update#### step=14 (0 | 1) ####, loss = 0.006279969122260809\n",
      "gaussian_aug\n",
      "####Model Update#### step=15 (0 | 1) ####, loss = 0.0007084095850586891\n",
      "randomReplace\n",
      "####Model Update#### step=16 (0 | 1) ####, loss = 2.0773077267222106e-05\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\r",
      "  0%|          | 0/57 [00:00<?, ?it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gaussian_blur\n",
      "####Model Update#### step=17 (0 | 1) ####, loss = 0.001526378095149994\n",
      "========> mean loss: 0.021543088179088146\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      " 65%|██████▍   | 37/57 [00:04<00:02,  8.44it/s]"
     ]
    }
   ],
   "source": [
    "trainer.trainning(model1, oldDomain, fewShotSet, unlabeledSet, U_label, isWeightInited=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "##### GSNR Test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>>>>>>MetaEvaluate Message>>>>>>>>>>>>>>>\n",
      "1043\n",
      "312\n",
      "tensor(0.5061, device='cuda:0') tensor(0.5338, device='cuda:0')\n",
      "0.6203259827420902 0.7147435897435898\n",
      "init: (array([0.89035917, 0.34241245]), array([0.58220025, 0.75213675]), array([0.70403587, 0.47058824]), array([809, 234]))\n",
      "valid: (array([0.95138889, 0.51190476]), array([0.62557078, 0.92473118]), array([0.75482094, 0.65900383]), array([219,  93]))\n",
      "<<<<<<<<<<<<<<<<<MetaEvaluate Message<<<<<<<<<<<<\n"
     ]
    }
   ],
   "source": [
    "idxs50 = IR_weighting2.weak_set_weights.argsort()[-int(len(unlabeled_set)*0.3):]\n",
    "LogSelectionInfo(IR_weighting2, entrophy, idxs50)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>>>>>>MetaEvaluate Message>>>>>>>>>>>>>>>\n",
      "1043\n",
      "941\n",
      "tensor(0.5061, device='cuda:0') tensor(0.4992, device='cuda:0')\n",
      "0.6203259827420902 0.6641870350690755\n",
      "init: (array([0.89035917, 0.34241245]), array([0.58220025, 0.75213675]), array([0.70403587, 0.47058824]), array([809, 234]))\n",
      "valid: (array([0.89105058, 0.3911007 ]), array([0.63788301, 0.74887892]), array([0.74350649, 0.51384615]), array([718, 223]))\n",
      "<<<<<<<<<<<<<<<<<MetaEvaluate Message<<<<<<<<<<<<\n"
     ]
    }
   ],
   "source": [
    "LogSelectionInfo(IR_weighting2, entrophy)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>>>>>>MetaEvaluate Message>>>>>>>>>>>>>>>\n",
      "1043\n",
      "208\n",
      "tensor(0.5061, device='cuda:0') tensor(0.4968, device='cuda:0')\n",
      "0.6203259827420902 0.7211538461538461\n",
      "init: (array([0.89035917, 0.34241245]), array([0.58220025, 0.75213675]), array([0.70403587, 0.47058824]), array([809, 234]))\n",
      "valid: (array([0.9       , 0.52040816]), array([0.67808219, 0.82258065]), array([0.7734375, 0.6375   ]), array([146,  62]))\n",
      "<<<<<<<<<<<<<<<<<MetaEvaluate Message<<<<<<<<<<<<\n"
     ]
    }
   ],
   "source": [
    "idxs50 = IR_weighting2.weak_set_weights.argsort()[-int(len(unlabeled_set)*0.2):]\n",
    "LogSelectionInfo(IR_weighting2, entrophy, idxs50)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  0%|          | 0/53 [00:00<?, ?it/s]/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.\n",
      "  warnings.warn(warning.format(ret))\n",
      "100%|██████████| 53/53 [00:07<00:00,  7.07it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.57928808/0.7300000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:22<00:00,  2.34it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.48it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([0.0010, 0.0010, 0.0010,  ..., 0.0010, 0.0010, 0.0010], device='cuda:0')\n",
      "self.weights: tensor([0., 0., 0.,  ..., 0., 0., 0.], device='cuda:0')\n",
      "self.weight_grads: tensor([ 1.0731e-05, -1.3341e-05,  4.9263e-06,  ...,  8.1353e-06,\n",
      "         1.9878e-05, -1.5102e-05], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.19it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 6.69585614/0.5000000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.26it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.45it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([0.0003, 0.0004, 0.0004,  ..., 0.0004, 0.0003, 0.0004], device='cuda:0')\n",
      "self.weights: tensor([-0.1065,  0.1324, -0.0489,  ..., -0.0807, -0.1973,  0.1499],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([-2.0479e-04,  7.3712e-06, -5.3998e-05,  ..., -2.1321e-04,\n",
      "        -2.0599e-04,  7.5012e-06], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.23it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 4.37530071/0.5100000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.28it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.36it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([0.0008, 0.0010, 0.0008,  ..., 0.0009, 0.0008, 0.0010], device='cuda:0')\n",
      "self.weights: tensor([-0.0332,  0.1298, -0.0296,  ..., -0.0044, -0.1235,  0.1472],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([-0.0005,  0.0004,  0.0001,  ..., -0.0005, -0.0005,  0.0004],\n",
      "       device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.26it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 3.17801712/0.5100000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:22<00:00,  2.31it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.22it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([1.0105e-05, 1.0331e-05, 9.1865e-06,  ..., 1.0446e-05, 9.2673e-06,\n",
      "        1.0501e-05], device='cuda:0')\n",
      "self.weights: tensor([ 0.0449,  0.0670, -0.0504,  ...,  0.0781, -0.0416,  0.0833],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([2.1112e-07, 1.3077e-06, 9.1897e-07,  ..., 3.2538e-07, 1.4598e-07,\n",
      "        1.3292e-06], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.02it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 2.08901873/0.5200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:22<00:00,  2.33it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.30it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([4.7427e-10, 4.7861e-10, 4.2756e-10,  ..., 4.8961e-10, 4.3527e-10,\n",
      "        4.8637e-10], device='cuda:0')\n",
      "self.weights: tensor([ 0.0424,  0.0516, -0.0612,  ...,  0.0743, -0.0434,  0.0676],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([-1.9128e-12,  2.6357e-12, -1.2600e-12,  ...,  3.6013e-13,\n",
      "        -1.2416e-12,  2.6788e-12], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  6.98it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 1.24925649/0.5100000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.30it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.50it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([1.0093e-05, 9.5713e-06, 9.0185e-06,  ..., 1.0101e-05, 9.1788e-06,\n",
      "        9.7206e-06], device='cuda:0')\n",
      "self.weights: tensor([ 0.0686,  0.0155, -0.0440,  ...,  0.0694, -0.0264,  0.0310],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([-5.3266e-08,  1.2495e-08, -4.7096e-08,  ..., -1.1262e-08,\n",
      "        -4.3592e-08,  1.2773e-08], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  6.98it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.73288713/0.6400000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.28it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.28it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([0.0007, 0.0006, 0.0006,  ..., 0.0007, 0.0006, 0.0006], device='cuda:0')\n",
      "self.weights: tensor([ 0.1371, -0.0006,  0.0166,  ...,  0.0838,  0.0297,  0.0146],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([-2.3775e-07,  4.9546e-07, -5.9797e-07,  ...,  3.4627e-07,\n",
      "        -1.8925e-07,  5.1817e-07], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  6.88it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.90421745/0.6400000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.27it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.58it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([8.9610e-08, 7.6202e-08, 8.0392e-08,  ..., 8.3326e-08, 8.0353e-08,\n",
      "        7.7304e-08], device='cuda:0')\n",
      "self.weights: tensor([ 0.1450, -0.0170,  0.0365,  ...,  0.0723,  0.0360, -0.0027],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([-1.8110e-09, -3.5822e-08,  6.8365e-10,  ..., -2.9820e-09,\n",
      "        -1.1038e-09, -3.7398e-08], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.40it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.81957794/0.6700000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.26it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.63it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([0.0007, 0.0006, 0.0006,  ..., 0.0006, 0.0006, 0.0006], device='cuda:0')\n",
      "self.weights: tensor([0.1463, 0.0072, 0.0360,  ..., 0.0743, 0.0367, 0.0226], device='cuda:0')\n",
      "self.weight_grads: tensor([ 5.9507e-05, -1.3227e-04,  6.5886e-05,  ...,  4.4234e-05,\n",
      "         5.8499e-05, -1.5514e-04], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.42it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 3.38158085/0.5100000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:22<00:00,  2.34it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.44it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([0.0006, 0.0006, 0.0006,  ..., 0.0006, 0.0006, 0.0006], device='cuda:0')\n",
      "self.weights: tensor([0.1351, 0.0320, 0.0237,  ..., 0.0661, 0.0258, 0.0517], device='cuda:0')\n",
      "self.weight_grads: tensor([-6.1055e-05,  2.1021e-05,  2.1917e-06,  ..., -5.0210e-05,\n",
      "        -6.0203e-05,  2.1440e-05], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.43it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 3.00921085/0.5100000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:22<00:00,  2.32it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.66it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([0.0011, 0.0010, 0.0010,  ..., 0.0010, 0.0010, 0.0010], device='cuda:0')\n",
      "self.weights: tensor([0.1768, 0.0177, 0.0222,  ..., 0.1003, 0.0668, 0.0371], device='cuda:0')\n",
      "self.weight_grads: tensor([-6.4415e-05,  5.7007e-05,  2.9479e-05,  ..., -4.7873e-05,\n",
      "        -6.7073e-05,  5.8127e-05], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  6.69it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 2.16956772/0.5200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.22it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.53it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([0.0010, 0.0006, 0.0007,  ..., 0.0009, 0.0009, 0.0006], device='cuda:0')\n",
      "self.weights: tensor([ 0.3206, -0.1096, -0.0436,  ...,  0.2072,  0.2166, -0.0927],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([-4.8420e-06,  2.8610e-06, -2.5032e-06,  ..., -2.8601e-07,\n",
      "        -3.3930e-06,  2.9104e-06], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  6.79it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.75427568/0.6200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.25it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.42it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([3.3104e-07, 1.9148e-07, 2.2194e-07,  ..., 2.7576e-07, 2.9184e-07,\n",
      "        1.9461e-07], device='cuda:0')\n",
      "self.weights: tensor([ 0.3943, -0.1532, -0.0056,  ...,  0.2116,  0.2682, -0.1370],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([-2.8205e-11,  2.1462e-10, -1.4882e-10,  ...,  2.1465e-10,\n",
      "        -2.7273e-11,  2.2361e-10], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.09it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.60149270/0.7100000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.23it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.63it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([1.7308e-11, 9.8325e-12, 1.1708e-11,  ..., 1.4160e-11, 1.5257e-11,\n",
      "        9.9863e-12], device='cuda:0')\n",
      "self.weights: tensor([ 0.3964, -0.1691,  0.0055,  ...,  0.1956,  0.2703, -0.1536],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([ 1.7108e-13, -1.4011e-13,  8.7822e-14,  ...,  2.7937e-14,\n",
      "         2.1640e-13, -2.4846e-13], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.19it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.60567273/0.7100000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.24it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.36it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([7.4832e-15, 4.2736e-15, 5.0692e-15,  ..., 6.1369e-15, 6.5916e-15,\n",
      "        4.3483e-15], device='cuda:0')\n",
      "self.weights: tensor([ 0.3935, -0.1667,  0.0040,  ...,  0.1951,  0.2666, -0.1494],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([ 8.6049e-17, -7.3892e-17,  4.7642e-17,  ...,  1.5440e-17,\n",
      "         1.0643e-16, -1.3264e-16], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.20it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.60982701/0.7100000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.30it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.34it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([1.4039e-18, 8.6126e-19, 9.6754e-19,  ..., 1.1883e-18, 1.2254e-18,\n",
      "        8.9967e-19], device='cuda:0')\n",
      "self.weights: tensor([ 0.3550, -0.1337, -0.0173,  ...,  0.1882,  0.2190, -0.0900],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([ 1.7990e-20, -1.7413e-20,  1.0718e-20,  ...,  3.5559e-21,\n",
      "         2.1690e-20, -3.2233e-20], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.20it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.61390036/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:22<00:00,  2.31it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.49it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([1.5106e-14, 9.7204e-15, 1.0513e-14,  ..., 1.3037e-14, 1.3119e-14,\n",
      "        1.0359e-14], device='cuda:0')\n",
      "self.weights: tensor([ 0.3307, -0.1102, -0.0318,  ...,  0.1834,  0.1897, -0.0465],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([ 2.0997e-16, -2.2423e-16,  1.3215e-16,  ...,  4.4417e-17,\n",
      "         2.4863e-16, -4.2374e-16], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.17it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.61786816/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:22<00:00,  2.31it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.43it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([1.9410e-10, 1.2655e-10, 1.3540e-10,  ..., 1.6836e-10, 1.6838e-10,\n",
      "        1.3569e-10], device='cuda:0')\n",
      "self.weights: tensor([ 0.3243, -0.1034, -0.0358,  ...,  0.1821,  0.1822, -0.0337],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([ 2.8754e-12, -3.2733e-12,  1.8835e-12,  ...,  6.3450e-13,\n",
      "         3.3643e-12, -6.2131e-12], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.22it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.62051100/0.7400000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:22<00:00,  2.32it/s]\n",
      "  2%|▏         | 1/53 [00:00<00:09,  5.42it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([1.9198e-06, 1.2562e-06, 1.3400e-06,  ..., 1.6675e-06, 1.6649e-06,\n",
      "        1.3492e-06], device='cuda:0')\n",
      "self.weights: tensor([ 0.3226, -0.1015, -0.0369,  ...,  0.1817,  0.1802, -0.0301],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([ 3.1850e-08, -3.3355e-08,  2.1440e-08,  ...,  8.7218e-09,\n",
      "         3.6313e-08, -6.4464e-08], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:07<00:00,  7.17it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 1.03434899/0.5800000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:23<00:00,  2.28it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u: tensor([4.6261e-06, 3.0285e-06, 3.2293e-06,  ..., 4.0187e-06, 4.0119e-06,\n",
      "        3.2534e-06], device='cuda:0')\n",
      "self.weights: tensor([ 0.3224, -0.1012, -0.0370,  ...,  0.1817,  0.1800, -0.0296],\n",
      "       device='cuda:0')\n",
      "self.weight_grads: tensor([-2.2133e-08,  3.0070e-11, -1.6204e-08,  ..., -6.5959e-09,\n",
      "        -1.8867e-08,  8.5080e-11], device='cuda:0')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[183,\n",
       " 917,\n",
       " 592,\n",
       " 328,\n",
       " 465,\n",
       " 800,\n",
       " 206,\n",
       " 140,\n",
       " 274,\n",
       " 248,\n",
       " 315,\n",
       " 553,\n",
       " 627,\n",
       " 336,\n",
       " 796,\n",
       " 683,\n",
       " 597,\n",
       " 823,\n",
       " 905,\n",
       " 880,\n",
       " 279,\n",
       " 138,\n",
       " 720,\n",
       " 518,\n",
       " 501,\n",
       " 17,\n",
       " 831,\n",
       " 978,\n",
       " 601,\n",
       " 165,\n",
       " 745,\n",
       " 608,\n",
       " 271,\n",
       " 882,\n",
       " 625,\n",
       " 121,\n",
       " 403,\n",
       " 797,\n",
       " 158,\n",
       " 1,\n",
       " 783,\n",
       " 1004,\n",
       " 702,\n",
       " 469,\n",
       " 753,\n",
       " 718,\n",
       " 69,\n",
       " 357,\n",
       " 821,\n",
       " 188,\n",
       " 698,\n",
       " 112,\n",
       " 435,\n",
       " 854,\n",
       " 677,\n",
       " 351,\n",
       " 773,\n",
       " 431,\n",
       " 33,\n",
       " 730,\n",
       " 596,\n",
       " 344,\n",
       " 560,\n",
       " 337,\n",
       " 258,\n",
       " 836,\n",
       " 493,\n",
       " 802,\n",
       " 957,\n",
       " 329,\n",
       " 166,\n",
       " 216,\n",
       " 227,\n",
       " 55,\n",
       " 23,\n",
       " 845,\n",
       " 249,\n",
       " 1041,\n",
       " 870,\n",
       " 137,\n",
       " 649,\n",
       " 822,\n",
       " 514,\n",
       " 546,\n",
       " 135,\n",
       " 582,\n",
       " 484,\n",
       " 90,\n",
       " 320,\n",
       " 629,\n",
       " 86,\n",
       " 478,\n",
       " 480,\n",
       " 424,\n",
       " 1016,\n",
       " 419,\n",
       " 816,\n",
       " 992,\n",
       " 511,\n",
       " 312,\n",
       " 263,\n",
       " 552,\n",
       " 1036,\n",
       " 20,\n",
       " 428,\n",
       " 322,\n",
       " 450,\n",
       " 470,\n",
       " 771,\n",
       " 6,\n",
       " 865,\n",
       " 113,\n",
       " 751,\n",
       " 149,\n",
       " 305,\n",
       " 13,\n",
       " 129,\n",
       " 920,\n",
       " 982,\n",
       " 909,\n",
       " 620,\n",
       " 536,\n",
       " 819,\n",
       " 440,\n",
       " 871,\n",
       " 291,\n",
       " 879,\n",
       " 793,\n",
       " 566,\n",
       " 814,\n",
       " 977,\n",
       " 280,\n",
       " 902,\n",
       " 892,\n",
       " 251,\n",
       " 367,\n",
       " 789,\n",
       " 756,\n",
       " 587,\n",
       " 31,\n",
       " 919,\n",
       " 319,\n",
       " 80,\n",
       " 813,\n",
       " 273,\n",
       " 340,\n",
       " 224,\n",
       " 940,\n",
       " 887,\n",
       " 383,\n",
       " 399,\n",
       " 924,\n",
       " 295,\n",
       " 213,\n",
       " 946,\n",
       " 232,\n",
       " 545,\n",
       " 684,\n",
       " 589,\n",
       " 689,\n",
       " 966,\n",
       " 799,\n",
       " 520,\n",
       " 200,\n",
       " 98,\n",
       " 160,\n",
       " 71,\n",
       " 456,\n",
       " 893,\n",
       " 522,\n",
       " 197,\n",
       " 374,\n",
       " 617,\n",
       " 712,\n",
       " 570,\n",
       " 628,\n",
       " 808,\n",
       " 398,\n",
       " 355,\n",
       " 1002,\n",
       " 99,\n",
       " 663,\n",
       " 927,\n",
       " 22,\n",
       " 220,\n",
       " 598,\n",
       " 974,\n",
       " 302,\n",
       " 890,\n",
       " 436,\n",
       " 11,\n",
       " 413,\n",
       " 393,\n",
       " 495,\n",
       " 953,\n",
       " 959,\n",
       " 949,\n",
       " 385,\n",
       " 851,\n",
       " 369,\n",
       " 907,\n",
       " 543,\n",
       " 438,\n",
       " 92,\n",
       " 744,\n",
       " 742,\n",
       " 93,\n",
       " 735,\n",
       " 644,\n",
       " 512,\n",
       " 205,\n",
       " 697,\n",
       " 289,\n",
       " 1033,\n",
       " 750,\n",
       " 1010,\n",
       " 131,\n",
       " 828,\n",
       " 714,\n",
       " 339,\n",
       " 834,\n",
       " 1013,\n",
       " 612,\n",
       " 632,\n",
       " 855,\n",
       " 869,\n",
       " 979,\n",
       " 281,\n",
       " 970,\n",
       " 895,\n",
       " 102,\n",
       " 561,\n",
       " 792,\n",
       " 331,\n",
       " 410,\n",
       " 588,\n",
       " 259,\n",
       " 911,\n",
       " 829,\n",
       " 489,\n",
       " 287,\n",
       " 5,\n",
       " 779,\n",
       " 235,\n",
       " 288,\n",
       " 933,\n",
       " 936,\n",
       " 35,\n",
       " 275,\n",
       " 757,\n",
       " 733,\n",
       " 981,\n",
       " 130,\n",
       " 63,\n",
       " 591,\n",
       " 703,\n",
       " 680,\n",
       " 651,\n",
       " 862,\n",
       " 122,\n",
       " 76,\n",
       " 371,\n",
       " 669,\n",
       " 642,\n",
       " 432,\n",
       " 639,\n",
       " 896,\n",
       " 768,\n",
       " 521,\n",
       " 530,\n",
       " 860,\n",
       " 990,\n",
       " 722,\n",
       " 770,\n",
       " 826,\n",
       " 527,\n",
       " 810,\n",
       " 650,\n",
       " 83,\n",
       " 934,\n",
       " 803,\n",
       " 900,\n",
       " 376,\n",
       " 72,\n",
       " 168,\n",
       " 28,\n",
       " 759,\n",
       " 942,\n",
       " 524,\n",
       " 976,\n",
       " 43,\n",
       " 621,\n",
       " 123,\n",
       " 95,\n",
       " 214,\n",
       " 100,\n",
       " 987,\n",
       " 485,\n",
       " 908,\n",
       " 373,\n",
       " 832,\n",
       " 171,\n",
       " 388,\n",
       " 558,\n",
       " 175,\n",
       " 379,\n",
       " 354,\n",
       " 94,\n",
       " 782,\n",
       " 962,\n",
       " 989,\n",
       " 12,\n",
       " 741,\n",
       " 807,\n",
       " 151,\n",
       " 207,\n",
       " 894,\n",
       " 1027,\n",
       " 84,\n",
       " 937,\n",
       " 968,\n",
       " 526,\n",
       " 671,\n",
       " 551,\n",
       " 678,\n",
       " 723,\n",
       " 846,\n",
       " 306,\n",
       " 874,\n",
       " 578,\n",
       " 349,\n",
       " 114,\n",
       " 422,\n",
       " 38,\n",
       " 212,\n",
       " 229,\n",
       " 146,\n",
       " 827,\n",
       " 348,\n",
       " 126,\n",
       " 218,\n",
       " 724,\n",
       " 785,\n",
       " 529,\n",
       " 662,\n",
       " 117,\n",
       " 877,\n",
       " 360,\n",
       " 421,\n",
       " 221,\n",
       " 285,\n",
       " 945,\n",
       " 414,\n",
       " 513,\n",
       " 408,\n",
       " 161,\n",
       " 333,\n",
       " 568,\n",
       " 755,\n",
       " 499,\n",
       " 661,\n",
       " 61,\n",
       " 330,\n",
       " 515,\n",
       " 838,\n",
       " 749,\n",
       " 580,\n",
       " 903,\n",
       " 935,\n",
       " 688,\n",
       " 169,\n",
       " 729,\n",
       " 682,\n",
       " 873,\n",
       " 767,\n",
       " 727,\n",
       " 496,\n",
       " 708,\n",
       " 1021,\n",
       " 193,\n",
       " 998,\n",
       " 774,\n",
       " 427,\n",
       " 317,\n",
       " 260,\n",
       " 208,\n",
       " 30,\n",
       " 375,\n",
       " 630,\n",
       " 497,\n",
       " 510,\n",
       " 463,\n",
       " 788,\n",
       " 555,\n",
       " 754,\n",
       " 111,\n",
       " 824,\n",
       " 452,\n",
       " 584,\n",
       " 186,\n",
       " 181,\n",
       " 679,\n",
       " 54,\n",
       " 299,\n",
       " 863,\n",
       " 167,\n",
       " 1018,\n",
       " 109,\n",
       " 777,\n",
       " 586,\n",
       " 817,\n",
       " 950,\n",
       " 696,\n",
       " 477,\n",
       " 764,\n",
       " 0,\n",
       " 425,\n",
       " 941,\n",
       " 1039,\n",
       " 872,\n",
       " 191,\n",
       " 694,\n",
       " 889,\n",
       " 505,\n",
       " 234,\n",
       " 8,\n",
       " 430,\n",
       " 467,\n",
       " 471,\n",
       " 556,\n",
       " 434,\n",
       " 654,\n",
       " 136,\n",
       " 765,\n",
       " 517,\n",
       " 673,\n",
       " 1028,\n",
       " 1014,\n",
       " 952,\n",
       " 504,\n",
       " 973,\n",
       " 77,\n",
       " 366,\n",
       " 272,\n",
       " 721,\n",
       " 342,\n",
       " 610,\n",
       " 308,\n",
       " 602,\n",
       " 575,\n",
       " 180,\n",
       " 384,\n",
       " 228,\n",
       " 455,\n",
       " 634,\n",
       " 68,\n",
       " 486,\n",
       " 1019,\n",
       " 1006,\n",
       " 847,\n",
       " 875,\n",
       " 407,\n",
       " 10,\n",
       " 185,\n",
       " 947,\n",
       " 411,\n",
       " 868,\n",
       " 507,\n",
       " 269,\n",
       " 139,\n",
       " 304,\n",
       " 600,\n",
       " 290,\n",
       " 994,\n",
       " 323,\n",
       " 914,\n",
       " 415,\n",
       " 293,\n",
       " 479,\n",
       " 298,\n",
       " 984,\n",
       " 198,\n",
       " 726,\n",
       " 219,\n",
       " 176,\n",
       " 7,\n",
       " 464,\n",
       " 685,\n",
       " 256,\n",
       " 858,\n",
       " 988,\n",
       " 239,\n",
       " 631,\n",
       " 508,\n",
       " 713,\n",
       " 818,\n",
       " 609,\n",
       " 245,\n",
       " 1024,\n",
       " 761,\n",
       " 1017,\n",
       " 1029,\n",
       " 967,\n",
       " 192,\n",
       " 173,\n",
       " 660,\n",
       " 184,\n",
       " 1000,\n",
       " 225,\n",
       " 326,\n",
       " 250,\n",
       " 897,\n",
       " 128,\n",
       " 944,\n",
       " 253,\n",
       " 44,\n",
       " 525,\n",
       " 277,\n",
       " 278,\n",
       " 73,\n",
       " 248,\n",
       " 140,\n",
       " 242,\n",
       " 917,\n",
       " 152,\n",
       " 328,\n",
       " 274,\n",
       " 386,\n",
       " 674,\n",
       " 533,\n",
       " 800,\n",
       " 917,\n",
       " 465,\n",
       " 734,\n",
       " 592,\n",
       " 437,\n",
       " 386,\n",
       " 328,\n",
       " 274,\n",
       " 3,\n",
       " 338,\n",
       " 336,\n",
       " 899,\n",
       " 963,\n",
       " 648,\n",
       " 880,\n",
       " 716,\n",
       " 823,\n",
       " 796,\n",
       " 442,\n",
       " 720,\n",
       " 17,\n",
       " 518,\n",
       " 199,\n",
       " 165,\n",
       " 53,\n",
       " 423,\n",
       " 468,\n",
       " 380,\n",
       " 978,\n",
       " 745,\n",
       " 608,\n",
       " 121,\n",
       " 482,\n",
       " 921,\n",
       " 271,\n",
       " 1,\n",
       " 25,\n",
       " 881,\n",
       " 158,\n",
       " 658,\n",
       " 1022,\n",
       " 79,\n",
       " 991,\n",
       " 1004,\n",
       " 188,\n",
       " 943,\n",
       " 357,\n",
       " 469,\n",
       " 718,\n",
       " 537,\n",
       " 458,\n",
       " 898,\n",
       " 698,\n",
       " 431,\n",
       " 33,\n",
       " 118,\n",
       " 503,\n",
       " 773,\n",
       " 971,\n",
       " 1007,\n",
       " 466,\n",
       " 283,\n",
       " 554,\n",
       " 836,\n",
       " 258,\n",
       " 329,\n",
       " 638,\n",
       " 395,\n",
       " 64,\n",
       " 567,\n",
       " 249,\n",
       " 845,\n",
       " 243,\n",
       " 137,\n",
       " 24,\n",
       " 227,\n",
       " 23,\n",
       " 216,\n",
       " 166,\n",
       " 573,\n",
       " 618,\n",
       " 629,\n",
       " 582,\n",
       " 267,\n",
       " 822,\n",
       " 90,\n",
       " 119,\n",
       " 842,\n",
       " 546,\n",
       " 478,\n",
       " 1016,\n",
       " 992,\n",
       " 312,\n",
       " 419,\n",
       " 404,\n",
       " 547,\n",
       " 948,\n",
       " 1011,\n",
       " 577,\n",
       " 833,\n",
       " 428,\n",
       " 143,\n",
       " 381,\n",
       " 202,\n",
       " 552,\n",
       " 771,\n",
       " 445,\n",
       " 263,\n",
       " 450,\n",
       " 352,\n",
       " 356,\n",
       " 129,\n",
       " 865,\n",
       " 149,\n",
       " 909,\n",
       " 39,\n",
       " 920,\n",
       " 297,\n",
       " 751,\n",
       " 879,\n",
       " 798,\n",
       " 291,\n",
       " 995,\n",
       " 620,\n",
       " 819,\n",
       " 871,\n",
       " 748,\n",
       " 382,\n",
       " 536,\n",
       " 300,\n",
       " 756,\n",
       " 993,\n",
       " 902,\n",
       " 876,\n",
       " 251,\n",
       " 977,\n",
       " 31,\n",
       " 280,\n",
       " 367,\n",
       " 319,\n",
       " 294,\n",
       " 196,\n",
       " 919,\n",
       " 273,\n",
       " 80,\n",
       " 887,\n",
       " 940,\n",
       " 928,\n",
       " 310,\n",
       " 689,\n",
       " 924,\n",
       " 472,\n",
       " 213,\n",
       " 946,\n",
       " 399,\n",
       " 91,\n",
       " 60,\n",
       " 736,\n",
       " 986,\n",
       " 150,\n",
       " 893,\n",
       " 363,\n",
       " 809,\n",
       " 98,\n",
       " 456,\n",
       " 559,\n",
       " 532,\n",
       " 522,\n",
       " 71,\n",
       " 628,\n",
       " 922,\n",
       " 75,\n",
       " 709,\n",
       " 808,\n",
       " 48,\n",
       " 1042,\n",
       " 617,\n",
       " 398,\n",
       " 355,\n",
       " 99,\n",
       " 812,\n",
       " 1015,\n",
       " 220,\n",
       " 453,\n",
       " 811,\n",
       " 22,\n",
       " 302,\n",
       " 890,\n",
       " 974,\n",
       " 369,\n",
       " 393,\n",
       " 953,\n",
       " 116,\n",
       " 389,\n",
       " 11,\n",
       " 147,\n",
       " 916,\n",
       " 195,\n",
       " 615,\n",
       " 668,\n",
       " 670,\n",
       " 645,\n",
       " 742,\n",
       " 93,\n",
       " 907,\n",
       " 599,\n",
       " 264,\n",
       " 841,\n",
       " 910,\n",
       " 476,\n",
       " 289,\n",
       " 56,\n",
       " 697,\n",
       " 276,\n",
       " 417,\n",
       " 750,\n",
       " 210,\n",
       " 1010,\n",
       " 391,\n",
       " 869,\n",
       " 855,\n",
       " 1037,\n",
       " 979,\n",
       " 1013,\n",
       " 475,\n",
       " 766,\n",
       " 632,\n",
       " 612,\n",
       " 281,\n",
       " 489,\n",
       " 34,\n",
       " 829,\n",
       " 334,\n",
       " 259,\n",
       " 311,\n",
       " 665,\n",
       " 194,\n",
       " 561,\n",
       " 911,\n",
       " 275,\n",
       " 757,\n",
       " 462,\n",
       " 779,\n",
       " 933,\n",
       " 288,\n",
       " 5,\n",
       " 287,\n",
       " 59,\n",
       " 235,\n",
       " 862,\n",
       " 733,\n",
       " 591,\n",
       " 715,\n",
       " 680,\n",
       " 981,\n",
       " 368,\n",
       " 122,\n",
       " 655,\n",
       " 593,\n",
       " 19,\n",
       " 768,\n",
       " 76,\n",
       " 521,\n",
       " 371,\n",
       " 270,\n",
       " 530,\n",
       " 896,\n",
       " 830,\n",
       " 642,\n",
       " 961,\n",
       " 303,\n",
       " 866,\n",
       " 770,\n",
       " 261,\n",
       " 815,\n",
       " 934,\n",
       " 722,\n",
       " 810,\n",
       " 990,\n",
       " 361,\n",
       " 562,\n",
       " 1001,\n",
       " 976,\n",
       " 481,\n",
       " 168,\n",
       " 72,\n",
       " 376,\n",
       " 614,\n",
       " 900,\n",
       " 883,\n",
       " 43,\n",
       " 999,\n",
       " 247,\n",
       " 214,\n",
       " 125,\n",
       " 904,\n",
       " 123,\n",
       " 908,\n",
       " 681,\n",
       " 354,\n",
       " 324,\n",
       " 175,\n",
       " 603,\n",
       " 388,\n",
       " 379,\n",
       " 583,\n",
       " 832,\n",
       " 94,\n",
       " 538,\n",
       " 857,\n",
       " 643,\n",
       " 937,\n",
       " 989,\n",
       " 894,\n",
       " 21,\n",
       " 647,\n",
       " 795,\n",
       " 741,\n",
       " 12,\n",
       " 551,\n",
       " 678,\n",
       " 457,\n",
       " 487,\n",
       " 405,\n",
       " 156,\n",
       " 671,\n",
       " 846,\n",
       " 791,\n",
       " 723,\n",
       " 114,\n",
       " 146,\n",
       " 827,\n",
       " 349,\n",
       " 212,\n",
       " 422,\n",
       " 229,\n",
       " 657,\n",
       " 126,\n",
       " 38,\n",
       " 244,\n",
       " 218,\n",
       " 420,\n",
       " 529,\n",
       " 724,\n",
       " 117,\n",
       " 29,\n",
       " 313,\n",
       " 662,\n",
       " 16,\n",
       " 285,\n",
       " 217,\n",
       " 346,\n",
       " 945,\n",
       " 161,\n",
       " 408,\n",
       " 333,\n",
       " 755,\n",
       " 358,\n",
       " 74,\n",
       " 838,\n",
       " 688,\n",
       " 14,\n",
       " 903,\n",
       " 955,\n",
       " 61,\n",
       " 330,\n",
       " 616,\n",
       " 580,\n",
       " 18,\n",
       " 704,\n",
       " 708,\n",
       " 853,\n",
       " 169,\n",
       " 727,\n",
       " 729,\n",
       " 767,\n",
       " 606,\n",
       " 569,\n",
       " 178,\n",
       " 849,\n",
       " 630,\n",
       " 182,\n",
       " 370,\n",
       " 454,\n",
       " 427,\n",
       " 30,\n",
       " 774,\n",
       " 693,\n",
       " 347,\n",
       " 824,\n",
       " 463,\n",
       " 969,\n",
       " 186,\n",
       " 510,\n",
       " 788,\n",
       " 555,\n",
       " 252,\n",
       " 314,\n",
       " 754,\n",
       " 181,\n",
       " 863,\n",
       " 418,\n",
       " 1018,\n",
       " 835,\n",
       " 1023,\n",
       " 498,\n",
       " 586,\n",
       " 174,\n",
       " 167,\n",
       " 401,\n",
       " 378,\n",
       " 1031,\n",
       " 1039,\n",
       " 209,\n",
       " 57,\n",
       " 633,\n",
       " 872,\n",
       " 162,\n",
       " 719,\n",
       " 694,\n",
       " 392,\n",
       " 191,\n",
       " 548,\n",
       " 471,\n",
       " 839,\n",
       " 1003,\n",
       " 429,\n",
       " 653,\n",
       " 672,\n",
       " 517,\n",
       " 170,\n",
       " 504,\n",
       " 136,\n",
       " 105,\n",
       " 654,\n",
       " 1014,\n",
       " 765,\n",
       " 531,\n",
       " 622,\n",
       " 246,\n",
       " 886,\n",
       " 973,\n",
       " 602,\n",
       " 575,\n",
       " 738,\n",
       " 366,\n",
       " 257,\n",
       " 342,\n",
       " 96,\n",
       " 455,\n",
       " 1019,\n",
       " 68,\n",
       " 534,\n",
       " 362,\n",
       " 690,\n",
       " 62,\n",
       " 486,\n",
       " 1006,\n",
       " 901,\n",
       " 595,\n",
       " 211,\n",
       " 507,\n",
       " 269,\n",
       " 1038,\n",
       " 635,\n",
       " 500,\n",
       " 364,\n",
       " 318,\n",
       " 947,\n",
       " ...]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PopOutV2(IR_weighting2, 10, max_meta_step=20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "    def PopOut(self, max_meta_step=5, pop_ratio=0.5, topk_ratio=0.5):\n",
    "        expand_idxs, valid_idxs = [], []\n",
    "        c_idxs = list(range(len(self.weak_set)))\n",
    "        self.weak_set_size = len(c_idxs)\n",
    "        few_shot_data, few_shot_data_list = self.FewShotDataList()\n",
    "        self.weak_set_weights = torch.zeros(len(self.weak_set), device=self.device)\n",
    "        self.weight_grads = torch.zeros(len(self.weak_set), device=self.device)\n",
    "        shuffled_indices = random.sample(c_idxs,\n",
    "                                         len(c_idxs)) * 2\n",
    "        init_state_dicts = self.model.state_dict()\n",
    "        for epoch in range(max_meta_step):\n",
    "            self.ClipValGradientV2(few_shot_data, few_shot_data_list, topk_ratio=topk_ratio)\n",
    "            for step in trange(0, len(c_idxs), self.batch_size):\n",
    "                indices = shuffled_indices[step:step + self.batch_size]\n",
    "                batch, indices = self.InnerBatch(indices, device=self.device)\n",
    "                grads = self.ComputeGrads4Weights(batch, few_shot_data, few_shot_data_list)\n",
    "                self.weight_grads[indices] = grads\n",
    "                expand_idxs, valid_idxs = self.ExpandValidIdxs(indices, valid_idxs,\n",
    "                                                               expand_idxs=expand_idxs,\n",
    "                                                               pop_ratio=pop_ratio)\n",
    "            eta = self.weightsLR(0.001, self.weight_grads)\n",
    "            self.weak_set_weights = self.weak_set_weights + eta*self.weight_grads\n",
    "            if epoch + 1 != max_meta_step:\n",
    "                self.model.load_state_dict(init_state_dicts)\n",
    "                self.model.zero_grad()\n",
    "                for i in trange(0, len(c_idxs), self.batch_size):\n",
    "                    indices = c_idxs[i:min(len(c_idxs), i+self.batch_size)]\n",
    "                    batch, indices = self.InnerBatch(indices, device=self.device)\n",
    "                    loss = self.LossList(batch)\n",
    "                    sum_loss = (self.weak_set_weights[indices]*loss).sum()\n",
    "                    sum_loss.backward()\n",
    "                self.model_optim.step()\n",
    "        return valid_idxs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "hidden": true,
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.57817476/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.\n",
      "  warnings.warn(warning.format(ret))\n",
      "100%|██████████| 53/53 [00:30<00:00,  1.77it/s]\n",
      "100%|██████████| 53/53 [00:14<00:00,  3.61it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.57808251/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:30<00:00,  1.72it/s]\n",
      "100%|██████████| 53/53 [00:13<00:00,  4.00it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.57791590/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:30<00:00,  1.76it/s]\n",
      "100%|██████████| 53/53 [00:13<00:00,  3.92it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.57770572/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:29<00:00,  1.77it/s]\n",
      "100%|██████████| 53/53 [00:13<00:00,  4.00it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.57749628/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 53/53 [00:30<00:00,  1.77it/s]\n",
      "100%|██████████| 53/53 [00:13<00:00,  3.96it/s]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[695,\n",
       " 803,\n",
       " 824,\n",
       " 299,\n",
       " 844,\n",
       " 795,\n",
       " 660,\n",
       " 195,\n",
       " 923,\n",
       " 291,\n",
       " 991,\n",
       " 999,\n",
       " 984,\n",
       " 125,\n",
       " 792,\n",
       " 318,\n",
       " 627,\n",
       " 828,\n",
       " 336,\n",
       " 317,\n",
       " 7,\n",
       " 500,\n",
       " 927,\n",
       " 592,\n",
       " 1019,\n",
       " 249,\n",
       " 1041,\n",
       " 393,\n",
       " 659,\n",
       " 815,\n",
       " 929,\n",
       " 88,\n",
       " 36,\n",
       " 390,\n",
       " 252,\n",
       " 830,\n",
       " 624,\n",
       " 76,\n",
       " 959,\n",
       " 493,\n",
       " 4,\n",
       " 852,\n",
       " 977,\n",
       " 1024,\n",
       " 515,\n",
       " 594,\n",
       " 543,\n",
       " 193,\n",
       " 982,\n",
       " 187,\n",
       " 505,\n",
       " 622,\n",
       " 469,\n",
       " 303,\n",
       " 870,\n",
       " 352,\n",
       " 1012,\n",
       " 919,\n",
       " 365,\n",
       " 435,\n",
       " 773,\n",
       " 820,\n",
       " 1015,\n",
       " 894,\n",
       " 264,\n",
       " 82,\n",
       " 989,\n",
       " 350,\n",
       " 726,\n",
       " 782,\n",
       " 430,\n",
       " 883,\n",
       " 132,\n",
       " 663,\n",
       " 533,\n",
       " 761,\n",
       " 836,\n",
       " 311,\n",
       " 697,\n",
       " 363,\n",
       " 93,\n",
       " 981,\n",
       " 996,\n",
       " 12,\n",
       " 580,\n",
       " 843,\n",
       " 1031,\n",
       " 325,\n",
       " 487,\n",
       " 657,\n",
       " 648,\n",
       " 349,\n",
       " 296,\n",
       " 312,\n",
       " 590,\n",
       " 682,\n",
       " 231,\n",
       " 547,\n",
       " 737,\n",
       " 42,\n",
       " 681,\n",
       " 897,\n",
       " 516,\n",
       " 322,\n",
       " 110,\n",
       " 417,\n",
       " 684,\n",
       " 887,\n",
       " 16,\n",
       " 932,\n",
       " 898,\n",
       " 607,\n",
       " 769,\n",
       " 1014,\n",
       " 1029,\n",
       " 1000,\n",
       " 236,\n",
       " 884,\n",
       " 753,\n",
       " 144,\n",
       " 446,\n",
       " 993,\n",
       " 387,\n",
       " 332,\n",
       " 404,\n",
       " 748,\n",
       " 557,\n",
       " 449,\n",
       " 841,\n",
       " 910,\n",
       " 1035,\n",
       " 934,\n",
       " 286,\n",
       " 33,\n",
       " 895,\n",
       " 398,\n",
       " 818,\n",
       " 542,\n",
       " 1037,\n",
       " 499,\n",
       " 127,\n",
       " 821,\n",
       " 194,\n",
       " 625,\n",
       " 892,\n",
       " 522,\n",
       " 861,\n",
       " 196,\n",
       " 228,\n",
       " 600,\n",
       " 826,\n",
       " 416,\n",
       " 275,\n",
       " 545,\n",
       " 907,\n",
       " 785,\n",
       " 699,\n",
       " 702,\n",
       " 260,\n",
       " 348,\n",
       " 160,\n",
       " 946,\n",
       " 751,\n",
       " 415,\n",
       " 709,\n",
       " 282,\n",
       " 574,\n",
       " 209,\n",
       " 972,\n",
       " 978,\n",
       " 729,\n",
       " 885,\n",
       " 805,\n",
       " 891,\n",
       " 671,\n",
       " 615,\n",
       " 295,\n",
       " 877,\n",
       " 687,\n",
       " 960,\n",
       " 94,\n",
       " 224,\n",
       " 591,\n",
       " 441,\n",
       " 39,\n",
       " 520,\n",
       " 38,\n",
       " 67,\n",
       " 518,\n",
       " 186,\n",
       " 979,\n",
       " 98,\n",
       " 134,\n",
       " 62,\n",
       " 778,\n",
       " 832,\n",
       " 1025,\n",
       " 586,\n",
       " 371,\n",
       " 287,\n",
       " 263,\n",
       " 675,\n",
       " 27,\n",
       " 220,\n",
       " 851,\n",
       " 424,\n",
       " 11,\n",
       " 525,\n",
       " 838,\n",
       " 1011,\n",
       " 865,\n",
       " 426,\n",
       " 588,\n",
       " 772,\n",
       " 73,\n",
       " 100,\n",
       " 171,\n",
       " 257,\n",
       " 353,\n",
       " 847,\n",
       " 692,\n",
       " 3,\n",
       " 553,\n",
       " 781,\n",
       " 96,\n",
       " 25,\n",
       " 95,\n",
       " 683,\n",
       " 356,\n",
       " 383,\n",
       " 391,\n",
       " 879,\n",
       " 284,\n",
       " 647,\n",
       " 230,\n",
       " 447,\n",
       " 477,\n",
       " 708,\n",
       " 735,\n",
       " 89,\n",
       " 703,\n",
       " 163,\n",
       " 271,\n",
       " 796,\n",
       " 562,\n",
       " 326,\n",
       " 521,\n",
       " 698,\n",
       " 764,\n",
       " 743,\n",
       " 179,\n",
       " 342,\n",
       " 225,\n",
       " 392,\n",
       " 596,\n",
       " 147,\n",
       " 601,\n",
       " 650,\n",
       " 1028,\n",
       " 56,\n",
       " 822,\n",
       " 421,\n",
       " 433,\n",
       " 1005,\n",
       " 351,\n",
       " 334,\n",
       " 774,\n",
       " 570,\n",
       " 745,\n",
       " 1018,\n",
       " 173,\n",
       " 182,\n",
       " 690,\n",
       " 597,\n",
       " 189,\n",
       " 508,\n",
       " 457,\n",
       " 819,\n",
       " 266,\n",
       " 83,\n",
       " 626,\n",
       " 880,\n",
       " 667,\n",
       " 652,\n",
       " 947,\n",
       " 786,\n",
       " 305,\n",
       " 483,\n",
       " 1039,\n",
       " 203,\n",
       " 117,\n",
       " 162,\n",
       " 150,\n",
       " 145,\n",
       " 618,\n",
       " 616,\n",
       " 5,\n",
       " 641,\n",
       " 534,\n",
       " 867,\n",
       " 313,\n",
       " 15,\n",
       " 926,\n",
       " 900,\n",
       " 126,\n",
       " 940,\n",
       " 57,\n",
       " 963,\n",
       " 568,\n",
       " 723,\n",
       " 661,\n",
       " 876,\n",
       " 1013,\n",
       " 258,\n",
       " 788,\n",
       " 968,\n",
       " 731,\n",
       " 112,\n",
       " 289,\n",
       " 665,\n",
       " 1038,\n",
       " 2,\n",
       " 850,\n",
       " 304,\n",
       " 621,\n",
       " 285,\n",
       " 274,\n",
       " 874,\n",
       " 22,\n",
       " 609,\n",
       " 523,\n",
       " 730,\n",
       " 323,\n",
       " 227,\n",
       " 400,\n",
       " 335,\n",
       " 620,\n",
       " 512,\n",
       " 787,\n",
       " 14,\n",
       " 976,\n",
       " 314,\n",
       " 945,\n",
       " 475,\n",
       " 839,\n",
       " 714,\n",
       " 277,\n",
       " 519,\n",
       " 233,\n",
       " 672,\n",
       " 297,\n",
       " 281,\n",
       " 221,\n",
       " 329,\n",
       " 931,\n",
       " 142,\n",
       " 881,\n",
       " 183,\n",
       " 1016,\n",
       " 793,\n",
       " 459,\n",
       " 765,\n",
       " 593,\n",
       " 949,\n",
       " 24,\n",
       " 954,\n",
       " 408,\n",
       " 526,\n",
       " 223,\n",
       " 742,\n",
       " 679,\n",
       " 530,\n",
       " 938,\n",
       " 259,\n",
       " 382,\n",
       " 754,\n",
       " 130,\n",
       " 980,\n",
       " 637,\n",
       " 578,\n",
       " 770,\n",
       " 290,\n",
       " 479,\n",
       " 437,\n",
       " 407,\n",
       " 463,\n",
       " 758,\n",
       " 909,\n",
       " 482,\n",
       " 871,\n",
       " 178,\n",
       " 610,\n",
       " 1002,\n",
       " 734,\n",
       " 149,\n",
       " 942,\n",
       " 409,\n",
       " 121,\n",
       " 235,\n",
       " 71,\n",
       " 888,\n",
       " 825,\n",
       " 216,\n",
       " 686,\n",
       " 480,\n",
       " 214,\n",
       " 800,\n",
       " 262,\n",
       " 6,\n",
       " 722,\n",
       " 440,\n",
       " 310,\n",
       " 166,\n",
       " 420,\n",
       " 953,\n",
       " 23,\n",
       " 315,\n",
       " 129,\n",
       " 642,\n",
       " 474,\n",
       " 645,\n",
       " 835,\n",
       " 156,\n",
       " 560,\n",
       " 540,\n",
       " 453,\n",
       " 484,\n",
       " 514,\n",
       " 658,\n",
       " 328,\n",
       " 19,\n",
       " 327,\n",
       " 606,\n",
       " 97,\n",
       " 635,\n",
       " 50,\n",
       " 762,\n",
       " 831,\n",
       " 111,\n",
       " 893,\n",
       " 902,\n",
       " 63,\n",
       " 85,\n",
       " 243,\n",
       " 427,\n",
       " 965,\n",
       " 890,\n",
       " 674,\n",
       " 834,\n",
       " 146,\n",
       " 564,\n",
       " 969,\n",
       " 656,\n",
       " 10,\n",
       " 464,\n",
       " 544,\n",
       " 611,\n",
       " 501,\n",
       " 452,\n",
       " 360,\n",
       " 928,\n",
       " 238,\n",
       " 476,\n",
       " 998,\n",
       " 889,\n",
       " 693,\n",
       " 498,\n",
       " 255,\n",
       " 575,\n",
       " 389,\n",
       " 202,\n",
       " 957,\n",
       " 316,\n",
       " 810,\n",
       " 43,\n",
       " 582,\n",
       " 213,\n",
       " 549,\n",
       " 853,\n",
       " 546,\n",
       " 364,\n",
       " 706,\n",
       " 680,\n",
       " 301,\n",
       " 232,\n",
       " 339,\n",
       " 537,\n",
       " 952,\n",
       " 399,\n",
       " 720,\n",
       " 65,\n",
       " 612,\n",
       " 396,\n",
       " 524,\n",
       " 664,\n",
       " 804,\n",
       " 845,\n",
       " 829,\n",
       " 465,\n",
       " 443,\n",
       " 355,\n",
       " 444,\n",
       " 472,\n",
       " 294,\n",
       " 466,\n",
       " 527,\n",
       " 34,\n",
       " 215,\n",
       " 585,\n",
       " 177,\n",
       " 251,\n",
       " 128,\n",
       " 864,\n",
       " 1007,\n",
       " 319,\n",
       " 200,\n",
       " 915,\n",
       " 169,\n",
       " 842,\n",
       " 456,\n",
       " 291,\n",
       " 195,\n",
       " 917,\n",
       " 803,\n",
       " 60,\n",
       " 299,\n",
       " 923,\n",
       " 359,\n",
       " 32,\n",
       " 267,\n",
       " 660,\n",
       " 917,\n",
       " 643,\n",
       " 359,\n",
       " 481,\n",
       " 267,\n",
       " 60,\n",
       " 273,\n",
       " 795,\n",
       " 195,\n",
       " 999,\n",
       " 125,\n",
       " 991,\n",
       " 317,\n",
       " 246,\n",
       " 458,\n",
       " 123,\n",
       " 750,\n",
       " 654,\n",
       " 318,\n",
       " 997,\n",
       " 393,\n",
       " 72,\n",
       " 592,\n",
       " 1023,\n",
       " 815,\n",
       " 500,\n",
       " 358,\n",
       " 429,\n",
       " 536,\n",
       " 935,\n",
       " 103,\n",
       " 79,\n",
       " 76,\n",
       " 529,\n",
       " 198,\n",
       " 830,\n",
       " 846,\n",
       " 1010,\n",
       " 252,\n",
       " 691,\n",
       " 193,\n",
       " 507,\n",
       " 515,\n",
       " 594,\n",
       " 1004,\n",
       " 428,\n",
       " 245,\n",
       " 4,\n",
       " 977,\n",
       " 303,\n",
       " 435,\n",
       " 919,\n",
       " 797,\n",
       " 573,\n",
       " 921,\n",
       " 122,\n",
       " 469,\n",
       " 61,\n",
       " 622,\n",
       " 989,\n",
       " 820,\n",
       " 726,\n",
       " 309,\n",
       " 773,\n",
       " 894,\n",
       " 264,\n",
       " 908,\n",
       " 74,\n",
       " 44,\n",
       " 533,\n",
       " 848,\n",
       " 697,\n",
       " 510,\n",
       " 378,\n",
       " 311,\n",
       " 836,\n",
       " 837,\n",
       " 856,\n",
       " 538,\n",
       " 1031,\n",
       " 357,\n",
       " 670,\n",
       " 657,\n",
       " 896,\n",
       " 93,\n",
       " 981,\n",
       " 368,\n",
       " 12,\n",
       " 580,\n",
       " 873,\n",
       " 648,\n",
       " 312,\n",
       " 349,\n",
       " 386,\n",
       " 423,\n",
       " 718,\n",
       " 296,\n",
       " 988,\n",
       " 547,\n",
       " 539,\n",
       " 684,\n",
       " 913,\n",
       " 897,\n",
       " 478,\n",
       " 757,\n",
       " 417,\n",
       " 887,\n",
       " 681,\n",
       " 16,\n",
       " 725,\n",
       " 462,\n",
       " 898,\n",
       " 903,\n",
       " 236,\n",
       " 532,\n",
       " 943,\n",
       " 354,\n",
       " 1014,\n",
       " 1029,\n",
       " 218,\n",
       " 208,\n",
       " 855,\n",
       " 992,\n",
       " 841,\n",
       " 603,\n",
       " 404,\n",
       " 910,\n",
       " 748,\n",
       " 531,\n",
       " 1037,\n",
       " 767,\n",
       " 33,\n",
       " 405,\n",
       " 398,\n",
       " 542,\n",
       " 302,\n",
       " 503,\n",
       " 184,\n",
       " 30,\n",
       " 600,\n",
       " 581,\n",
       " 196,\n",
       " 522,\n",
       " 724,\n",
       " 68,\n",
       " 48,\n",
       " 388,\n",
       " 194,\n",
       " 367,\n",
       " 628,\n",
       " 131,\n",
       " 348,\n",
       " 785,\n",
       " 275,\n",
       " 181,\n",
       " 808,\n",
       " 91,\n",
       " 31,\n",
       " 907,\n",
       " 292,\n",
       " 707,\n",
       " 677,\n",
       " 137,\n",
       " 709,\n",
       " 950,\n",
       " 946,\n",
       " 209,\n",
       " 978,\n",
       " 751,\n",
       " 170,\n",
       " 885,\n",
       " 973,\n",
       " 729,\n",
       " 857,\n",
       " 671,\n",
       " 766,\n",
       " 380,\n",
       " 615,\n",
       " 442,\n",
       " 591,\n",
       " 186,\n",
       " 39,\n",
       " 518,\n",
       " 986,\n",
       " 760,\n",
       " 878,\n",
       " 736,\n",
       " 94,\n",
       " 38,\n",
       " 381,\n",
       " 995,\n",
       " 979,\n",
       " 586,\n",
       " 832,\n",
       " 287,\n",
       " 395,\n",
       " 62,\n",
       " 561,\n",
       " 974,\n",
       " 424,\n",
       " 525,\n",
       " 838,\n",
       " 489,\n",
       " 376,\n",
       " 220,\n",
       " 11,\n",
       " 675,\n",
       " 1011,\n",
       " 263,\n",
       " 100,\n",
       " 171,\n",
       " 866,\n",
       " 206,\n",
       " 809,\n",
       " 772,\n",
       " 865,\n",
       " 188,\n",
       " 555,\n",
       " 257,\n",
       " 858,\n",
       " 78,\n",
       " 356,\n",
       " 704,\n",
       " 1020,\n",
       " 116,\n",
       " 80,\n",
       " 96,\n",
       " 25,\n",
       " 3,\n",
       " 879,\n",
       " 217,\n",
       " 780,\n",
       " 447,\n",
       " 735,\n",
       " 944,\n",
       " 955,\n",
       " 647,\n",
       " 284,\n",
       " 391,\n",
       " 689,\n",
       " 521,\n",
       " 698,\n",
       " 629,\n",
       " 937,\n",
       " 630,\n",
       " 811,\n",
       " 755,\n",
       " 271,\n",
       " 796,\n",
       " 225,\n",
       " 56,\n",
       " 81,\n",
       " 601,\n",
       " 342,\n",
       " 468,\n",
       " 147,\n",
       " 18,\n",
       " 454,\n",
       " 1006,\n",
       " 421,\n",
       " 455,\n",
       " 745,\n",
       " 1018,\n",
       " 334,\n",
       " 419,\n",
       " 822,\n",
       " 920,\n",
       " 330,\n",
       " 774,\n",
       " 51,\n",
       " 457,\n",
       " 823,\n",
       " 552,\n",
       " 362,\n",
       " 690,\n",
       " 819,\n",
       " 508,\n",
       " 182,\n",
       " 324,\n",
       " 425,\n",
       " 492,\n",
       " 278,\n",
       " 614,\n",
       " 947,\n",
       " 667,\n",
       " 1039,\n",
       " 872,\n",
       " 719,\n",
       " 632,\n",
       " 212,\n",
       " 617,\n",
       " 229,\n",
       " 162,\n",
       " 5,\n",
       " 916,\n",
       " 370,\n",
       " 662,\n",
       " 616,\n",
       " 971,\n",
       " 926,\n",
       " 276,\n",
       " 57,\n",
       " 313,\n",
       " 940,\n",
       " 583,\n",
       " 126,\n",
       " 723,\n",
       " 900,\n",
       " 167,\n",
       " 112,\n",
       " 289,\n",
       " 298,\n",
       " 258,\n",
       " 788,\n",
       " 118,\n",
       " 1013,\n",
       " 876,\n",
       " 665,\n",
       " 599,\n",
       " 2,\n",
       " 248,\n",
       " 285,\n",
       " 495,\n",
       " 1038,\n",
       " 727,\n",
       " 274,\n",
       " 771,\n",
       " 1003,\n",
       " 22,\n",
       " 323,\n",
       " 434,\n",
       " 114,\n",
       " 227,\n",
       " 523,\n",
       " 14,\n",
       " 827,\n",
       " 168,\n",
       " 366,\n",
       " 620,\n",
       " 644,\n",
       " 277,\n",
       " 270,\n",
       " 976,\n",
       " 839,\n",
       " 633,\n",
       " 486,\n",
       " 475,\n",
       " 672,\n",
       " 314,\n",
       " 535,\n",
       " 1016,\n",
       " 931,\n",
       " 904,\n",
       " 431,\n",
       " 329,\n",
       " 297,\n",
       " 281,\n",
       " 881,\n",
       " 911,\n",
       " 408,\n",
       " 24,\n",
       " 418,\n",
       " 849,\n",
       " 165,\n",
       " 223,\n",
       " 53,\n",
       " 742,\n",
       " 765,\n",
       " 593,\n",
       " 491,\n",
       " 554,\n",
       " 259,\n",
       " 530,\n",
       " 637,\n",
       " 256,\n",
       " 90,\n",
       " 638,\n",
       " 382,\n",
       " 754,\n",
       " 261,\n",
       " 688,\n",
       " 909,\n",
       " 437,\n",
       " 559,\n",
       " 668,\n",
       " 482,\n",
       " 758,\n",
       " 871,\n",
       " 948,\n",
       " 734,\n",
       " 401,\n",
       " 239,\n",
       " 121,\n",
       " 71,\n",
       " 119,\n",
       " 655,\n",
       " 64,\n",
       " 235,\n",
       " 178,\n",
       " 99,\n",
       " 262,\n",
       " 812,\n",
       " 800,\n",
       " 722,\n",
       " 216,\n",
       " 1,\n",
       " 450,\n",
       " 280,\n",
       " 901,\n",
       " 420,\n",
       " 924,\n",
       " 23,\n",
       " 953,\n",
       " 29,\n",
       " 166,\n",
       " 642,\n",
       " 310,\n",
       " 474,\n",
       " 577,\n",
       " 738,\n",
       " 779,\n",
       " 835,\n",
       " 453,\n",
       " 156,\n",
       " 645,\n",
       " 333,\n",
       " 962,\n",
       " 328,\n",
       " 59,\n",
       " 19,\n",
       " 983,\n",
       " 893,\n",
       " 733,\n",
       " 471,\n",
       " 715,\n",
       " 143,\n",
       " 635,\n",
       " 606,\n",
       " 379,\n",
       " 244,\n",
       " 674,\n",
       " 146,\n",
       " 85,\n",
       " 902,\n",
       " 791,\n",
       " 1042,\n",
       " 210,\n",
       " 890,\n",
       " 427,\n",
       " 501,\n",
       " 360,\n",
       " 564,\n",
       " 969,\n",
       " 52,\n",
       " 608,\n",
       " 199,\n",
       " 464,\n",
       " 288,\n",
       " 158,\n",
       " 575,\n",
       " 676,\n",
       " 255,\n",
       " 498,\n",
       " 389,\n",
       " 653,\n",
       " 741,\n",
       " 445,\n",
       " 928,\n",
       " 693,\n",
       " ...]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PopOut(IR_weighting2, pop_ratio=0.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>>>>>>MetaEvaluate Message>>>>>>>>>>>>>>>\n",
      "1043\n",
      "375\n",
      "tensor(0.5061, device='cuda:0') tensor(0.4852, device='cuda:0')\n",
      "0.6203259827420902 0.5866666666666667\n",
      "init: (array([0.89035917, 0.34241245]), array([0.58220025, 0.75213675]), array([0.70403587, 0.47058824]), array([809, 234]))\n",
      "valid: (array([0.83064516, 0.46613546]), array([0.43459916, 0.84782609]), array([0.57063712, 0.60154242]), array([237, 138]))\n",
      "<<<<<<<<<<<<<<<<<MetaEvaluate Message<<<<<<<<<<<<\n"
     ]
    }
   ],
   "source": [
    "LogSelectionInfo(IR_weighting2, entrophy)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([ 0.3466, -0.1013, -0.0193,  ...,  0.1889,  0.2006, -0.0297],\n",
       "       device='cuda:0')"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "IR_weighting2.weak_set_weights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>>>>>>MetaEvaluate Message>>>>>>>>>>>>>>>\n",
      "1043\n",
      "104\n",
      "tensor(0.5061, device='cuda:0') tensor(0.4139, device='cuda:0')\n",
      "0.6203259827420902 0.6153846153846154\n",
      "init: (array([0.89035917, 0.34241245]), array([0.58220025, 0.75213675]), array([0.70403587, 0.47058824]), array([809, 234]))\n",
      "valid: (array([0.8125    , 0.52777778]), array([0.43333333, 0.86363636]), array([0.56521739, 0.65517241]), array([60, 44]))\n",
      "<<<<<<<<<<<<<<<<<MetaEvaluate Message<<<<<<<<<<<<\n"
     ]
    }
   ],
   "source": [
    "idxs50 = IR_weighting2.weak_set_weights.argsort()[-int(len(unlabeled_set)*0.1):]\n",
    "LogSelectionInfo(IR_weighting2, entrophy, idxs50)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,\n",
       "        1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0,\n",
       "        0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0,\n",
       "        0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1,\n",
       "        0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1,\n",
       "        1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0,\n",
       "        1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,\n",
       "        0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1,\n",
       "        0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "        0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0,\n",
       "        1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,\n",
       "        0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,\n",
       "        0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "torch.tensor(unlabeled_set.data_y).argmax(dim=1)[idxs50]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "def PopOut(self, pseaudo_idxs=None, pop_ratio=0.5, topk_ratio=0.5):\n",
    "    expand_idxs, valid_idxs = [], []\n",
    "    c_idxs = set(range(len(self.weak_set))) if pseaudo_idxs is None else \\\n",
    "        set(range(len(self.weak_set))) - set(pseaudo_idxs)\n",
    "    c_idxs = list(c_idxs) if len(self.expand_idxs) == 0 else \\\n",
    "        list(c_idxs - set(self.expand_idxs))\n",
    "    self.weak_set_size = len(c_idxs)\n",
    "    few_shot_data, few_shot_data_list = self.FewShotDataList()\n",
    "    self.ClipValGradientV2(few_shot_data, few_shot_data_list, topk_ratio=topk_ratio)\n",
    "    self.weak_set_weights = torch.zeros(len(self.weak_set), device=self.device)\n",
    "    shuffled_indices = random.sample(c_idxs,\n",
    "                                     len(c_idxs)) * 2\n",
    "    for step in range(0, len(c_idxs), self.batch_size):\n",
    "        indices = shuffled_indices[step:step + self.batch_size]\n",
    "        batch, indices = self.InnerBatch(indices, device=self.device)\n",
    "        grads = self.ComputeGrads4Weights(batch, few_shot_data, few_shot_data_list)\n",
    "        self.weak_set_weights[indices] = self.weak_set_weights[indices] + grads\n",
    "        expand_idxs, valid_idxs = self.ExpandValidIdxs(indices, valid_idxs,\n",
    "                                                       expand_idxs=expand_idxs,\n",
    "                                                       pop_ratio=pop_ratio)\n",
    "    return valid_idxs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.58245674/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.\n",
      "  warnings.warn(warning.format(ret))\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661, 944, 44, 390, 816, 772, 903, 52, 557, 342, 575]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661, 944, 44, 390, 816, 772, 903, 52, 557, 342, 575, 440, 102, 604, 446, 1059, 885, 628, 292, 754, 967]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661, 944, 44, 390, 816, 772, 903, 52, 557, 342, 575, 440, 102, 604, 446, 1059, 885, 628, 292, 754, 967, 684, 36, 599, 554, 460, 464, 593, 216, 652, 954]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661, 944, 44, 390, 816, 772, 903, 52, 557, 342, 575, 440, 102, 604, 446, 1059, 885, 628, 292, 754, 967, 684, 36, 599, 554, 460, 464, 593, 216, 652, 954, 847, 48, 996, 26, 588, 269, 178, 319, 708, 180]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661, 944, 44, 390, 816, 772, 903, 52, 557, 342, 575, 440, 102, 604, 446, 1059, 885, 628, 292, 754, 967, 684, 36, 599, 554, 460, 464, 593, 216, 652, 954, 847, 48, 996, 26, 588, 269, 178, 319, 708, 180, 701, 146, 110, 552, 854, 1004, 734, 778, 168, 510]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661, 944, 44, 390, 816, 772, 903, 52, 557, 342, 575, 440, 102, 604, 446, 1059, 885, 628, 292, 754, 967, 684, 36, 599, 554, 460, 464, 593, 216, 652, 954, 847, 48, 996, 26, 588, 269, 178, 319, 708, 180, 701, 146, 110, 552, 854, 1004, 734, 778, 168, 510, 845, 586, 40, 160, 641, 681, 805, 988, 672, 301]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661, 944, 44, 390, 816, 772, 903, 52, 557, 342, 575, 440, 102, 604, 446, 1059, 885, 628, 292, 754, 967, 684, 36, 599, 554, 460, 464, 593, 216, 652, 954, 847, 48, 996, 26, 588, 269, 178, 319, 708, 180, 701, 146, 110, 552, 854, 1004, 734, 778, 168, 510, 845, 586, 40, 160, 641, 681, 805, 988, 672, 301, 993, 351, 1011, 927, 355, 964, 143, 391, 644, 95]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661, 944, 44, 390, 816, 772, 903, 52, 557, 342, 575, 440, 102, 604, 446, 1059, 885, 628, 292, 754, 967, 684, 36, 599, 554, 460, 464, 593, 216, 652, 954, 847, 48, 996, 26, 588, 269, 178, 319, 708, 180, 701, 146, 110, 552, 854, 1004, 734, 778, 168, 510, 845, 586, 40, 160, 641, 681, 805, 988, 672, 301, 993, 351, 1011, 927, 355, 964, 143, 391, 644, 95, 789, 134, 834, 559, 533, 716, 49, 942, 1052, 639]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661, 944, 44, 390, 816, 772, 903, 52, 557, 342, 575, 440, 102, 604, 446, 1059, 885, 628, 292, 754, 967, 684, 36, 599, 554, 460, 464, 593, 216, 652, 954, 847, 48, 996, 26, 588, 269, 178, 319, 708, 180, 701, 146, 110, 552, 854, 1004, 734, 778, 168, 510, 845, 586, 40, 160, 641, 681, 805, 988, 672, 301, 993, 351, 1011, 927, 355, 964, 143, 391, 644, 95, 789, 134, 834, 559, 533, 716, 49, 942, 1052, 639, 508, 409, 252, 545, 989, 67, 415, 736, 861, 874]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661, 944, 44, 390, 816, 772, 903, 52, 557, 342, 575, 440, 102, 604, 446, 1059, 885, 628, 292, 754, 967, 684, 36, 599, 554, 460, 464, 593, 216, 652, 954, 847, 48, 996, 26, 588, 269, 178, 319, 708, 180, 701, 146, 110, 552, 854, 1004, 734, 778, 168, 510, 845, 586, 40, 160, 641, 681, 805, 988, 672, 301, 993, 351, 1011, 927, 355, 964, 143, 391, 644, 95, 789, 134, 834, 559, 533, 716, 49, 942, 1052, 639, 508, 409, 252, 545, 989, 67, 415, 736, 861, 874, 185, 712, 329, 602, 103, 53, 61, 271, 468, 1010]\n",
      "valid_idxs: [43, 951, 565, 613, 992, 743, 404, 144, 626, 826, 1112, 1002, 211, 837, 594, 78, 850, 1068, 275, 763, 250, 980, 612, 321, 348, 499, 922, 393, 731, 420, 941, 968, 786, 896, 427, 37, 450, 1111, 762, 114, 860, 191, 18, 857, 305, 738, 395, 694, 89, 1024, 723, 788, 106, 633, 219, 139, 354, 1027, 198, 685, 410, 1055, 1075, 949, 776, 630, 183, 1082, 757, 132, 899, 781, 982, 525, 86, 995, 704, 960, 80, 650, 760, 1038, 1008, 1065, 1099, 332, 925, 13, 475, 295, 1000, 511, 740, 808, 715, 94, 814, 658, 19, 969, 555, 1115, 267, 858, 526, 616, 126, 431, 700, 373, 835, 107, 512, 667, 281, 560, 113, 38, 81, 720, 919, 631, 284, 1093, 955, 330, 1022, 958, 1051, 651, 923, 259, 855, 488, 670, 263, 598, 642, 15, 369, 123, 561, 782, 197, 606, 812, 921, 70, 710, 436, 478, 665, 758, 939, 243, 8, 609, 215, 170, 848, 236, 230, 1018, 733, 108, 765, 1050, 539, 840, 550, 629, 583, 1077, 451, 345, 849, 744, 316, 62, 424, 210, 268, 735, 524, 306, 1007, 516, 1045, 551, 127, 618, 1106, 863, 498, 69, 157, 825, 27, 334, 853, 997, 1060, 698, 817, 21, 318, 7, 692, 171, 518, 975, 484, 1067, 572, 480, 169, 664, 530, 775, 363, 405, 517, 643, 538, 836, 697, 199, 535, 382, 445, 718, 253, 233, 447, 774, 362, 124, 804, 1083, 985, 1117, 956, 907, 137, 287, 338, 859, 87, 573, 920, 41, 695, 4, 1031, 251, 752, 473, 938, 181, 966, 239, 767, 422, 582, 928, 156, 844, 9, 414, 726, 485, 84, 1044, 1047, 174, 645, 574, 589, 438, 1020, 865, 244, 90, 600, 264, 607, 987, 581, 448, 703, 5, 940, 577, 950, 881, 862, 189, 562, 1013, 195, 407, 184, 1097, 637, 959, 481, 201, 272, 1120, 893, 1016, 74, 377, 553, 258, 1001, 164, 426, 501, 619, 822, 519, 237, 828, 882, 890, 592, 889, 1110, 815, 303, 529, 158, 531, 669, 547, 884, 1087, 727, 112, 311, 320, 689, 371, 213, 496, 800, 242, 315, 152, 381, 449, 423, 204, 79, 45, 291, 459, 625, 280, 729, 872, 328, 905, 454, 809, 676, 528, 12, 521, 1071, 504, 357, 182, 714, 16, 317, 1028, 385, 1098, 1026, 368, 344, 687, 293, 883, 875, 476, 372, 623, 101, 1073, 456, 749, 413, 779, 705, 1062, 241, 1086, 167, 309, 161, 984, 931, 75, 57, 304, 412, 394, 617, 548, 1118, 149, 682, 1069, 654, 261, 751, 756, 900, 926, 1063, 411, 947, 983, 986, 901, 489, 396, 341, 249, 620, 221, 979, 1076, 978, 220, 770, 492, 483, 846, 1021, 442, 209, 878, 1017, 1116, 111, 486, 310, 240, 702, 807, 327, 842, 6, 867, 443, 661, 944, 44, 390, 816, 772, 903, 52, 557, 342, 575, 440, 102, 604, 446, 1059, 885, 628, 292, 754, 967, 684, 36, 599, 554, 460, 464, 593, 216, 652, 954, 847, 48, 996, 26, 588, 269, 178, 319, 708, 180, 701, 146, 110, 552, 854, 1004, 734, 778, 168, 510, 845, 586, 40, 160, 641, 681, 805, 988, 672, 301, 993, 351, 1011, 927, 355, 964, 143, 391, 644, 95, 789, 134, 834, 559, 533, 716, 49, 942, 1052, 639, 508, 409, 252, 545, 989, 67, 415, 736, 861, 874, 185, 712, 329, 602, 103, 53, 61, 271, 468, 1010, 951, 565, 613, 992, 743, 404, 270, 144, 626, 826]\n",
      ">>>>>>>MetaEvaluate Message>>>>>>>>>>>>>>>\n",
      "1121\n",
      "313\n",
      "tensor(0.4784, device='cuda:0') tensor(0.5662, device='cuda:0')\n",
      "0.6904549509366636 0.6996805111821086\n",
      "0.6996805111821086 0.6996805111821086\n",
      "0.4639830508474576 1.0\n",
      "0.5579617834394905 0.8233082706766918\n",
      "<<<<<<<<<<<<<<<<<MetaEvaluate Message<<<<<<<<<<<<\n"
     ]
    }
   ],
   "source": [
    "t0 = time.time()\n",
    "PopOut(IR_weighting2, topk_ratio=0.5)\n",
    "LogSelectionInfo(IR_weighting2, entrophy)\n",
    "t1 = time.time()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "30.49319076538086"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t1-t0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.58245674/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.\n",
      "  warnings.warn(warning.format(ret))\n",
      "100%|██████████| 57/57 [00:24<00:00,  2.34it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.58245674/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:24<00:00,  2.36it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.58245674/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:24<00:00,  2.37it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.58245674/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:23<00:00,  2.38it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.58245674/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:24<00:00,  2.36it/s]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[249,\n",
       " 803,\n",
       " 246,\n",
       " 535,\n",
       " 887,\n",
       " 197,\n",
       " 852,\n",
       " 199,\n",
       " 728,\n",
       " 680,\n",
       " 141,\n",
       " 700,\n",
       " 211,\n",
       " 423,\n",
       " 1048,\n",
       " 763,\n",
       " 913,\n",
       " 205,\n",
       " 990,\n",
       " 687,\n",
       " 727,\n",
       " 523,\n",
       " 435,\n",
       " 1050,\n",
       " 66,\n",
       " 862,\n",
       " 70,\n",
       " 998,\n",
       " 930,\n",
       " 720,\n",
       " 915,\n",
       " 442,\n",
       " 51,\n",
       " 1118,\n",
       " 898,\n",
       " 686,\n",
       " 585,\n",
       " 529,\n",
       " 1027,\n",
       " 273,\n",
       " 997,\n",
       " 510,\n",
       " 833,\n",
       " 268,\n",
       " 923,\n",
       " 230,\n",
       " 973,\n",
       " 368,\n",
       " 460,\n",
       " 290,\n",
       " 787,\n",
       " 889,\n",
       " 373,\n",
       " 140,\n",
       " 813,\n",
       " 560,\n",
       " 1061,\n",
       " 1078,\n",
       " 980,\n",
       " 314,\n",
       " 649,\n",
       " 837,\n",
       " 762,\n",
       " 421,\n",
       " 654,\n",
       " 149,\n",
       " 417,\n",
       " 429,\n",
       " 978,\n",
       " 784,\n",
       " 977,\n",
       " 856,\n",
       " 974,\n",
       " 799,\n",
       " 1092,\n",
       " 441,\n",
       " 1009,\n",
       " 655,\n",
       " 586,\n",
       " 491,\n",
       " 148,\n",
       " 961,\n",
       " 364,\n",
       " 183,\n",
       " 947,\n",
       " 153,\n",
       " 816,\n",
       " 638,\n",
       " 190,\n",
       " 615,\n",
       " 430,\n",
       " 895,\n",
       " 809,\n",
       " 174,\n",
       " 155,\n",
       " 291,\n",
       " 919,\n",
       " 877,\n",
       " 146,\n",
       " 248,\n",
       " 124,\n",
       " 610,\n",
       " 607,\n",
       " 335,\n",
       " 304,\n",
       " 963,\n",
       " 321,\n",
       " 131,\n",
       " 482,\n",
       " 640,\n",
       " 534,\n",
       " 122,\n",
       " 203,\n",
       " 7,\n",
       " 218,\n",
       " 450,\n",
       " 595,\n",
       " 922,\n",
       " 1102,\n",
       " 287,\n",
       " 87,\n",
       " 115,\n",
       " 360,\n",
       " 1046,\n",
       " 975,\n",
       " 68,\n",
       " 593,\n",
       " 1041,\n",
       " 893,\n",
       " 98,\n",
       " 714,\n",
       " 393,\n",
       " 54,\n",
       " 0,\n",
       " 315,\n",
       " 347,\n",
       " 691,\n",
       " 675,\n",
       " 277,\n",
       " 79,\n",
       " 512,\n",
       " 1017,\n",
       " 580,\n",
       " 65,\n",
       " 844,\n",
       " 1059,\n",
       " 330,\n",
       " 678,\n",
       " 673,\n",
       " 189,\n",
       " 29,\n",
       " 841,\n",
       " 826,\n",
       " 383,\n",
       " 22,\n",
       " 173,\n",
       " 235,\n",
       " 965,\n",
       " 996,\n",
       " 252,\n",
       " 870,\n",
       " 262,\n",
       " 804,\n",
       " 397,\n",
       " 843,\n",
       " 114,\n",
       " 592,\n",
       " 839,\n",
       " 616,\n",
       " 177,\n",
       " 738,\n",
       " 112,\n",
       " 366,\n",
       " 897,\n",
       " 1043,\n",
       " 834,\n",
       " 307,\n",
       " 331,\n",
       " 379,\n",
       " 629,\n",
       " 400,\n",
       " 744,\n",
       " 398,\n",
       " 697,\n",
       " 779,\n",
       " 201,\n",
       " 39,\n",
       " 620,\n",
       " 945,\n",
       " 721,\n",
       " 644,\n",
       " 818,\n",
       " 706,\n",
       " 854,\n",
       " 692,\n",
       " 514,\n",
       " 415,\n",
       " 1006,\n",
       " 1000,\n",
       " 669,\n",
       " 474,\n",
       " 184,\n",
       " 1114,\n",
       " 159,\n",
       " 96,\n",
       " 462,\n",
       " 325,\n",
       " 110,\n",
       " 1035,\n",
       " 416,\n",
       " 358,\n",
       " 1005,\n",
       " 1069,\n",
       " 225,\n",
       " 1018,\n",
       " 298,\n",
       " 207,\n",
       " 1028,\n",
       " 716,\n",
       " 267,\n",
       " 24,\n",
       " 736,\n",
       " 874,\n",
       " 257,\n",
       " 129,\n",
       " 271,\n",
       " 186,\n",
       " 614,\n",
       " 33,\n",
       " 32,\n",
       " 855,\n",
       " 41,\n",
       " 138,\n",
       " 46,\n",
       " 1045,\n",
       " 868,\n",
       " 626,\n",
       " 611,\n",
       " 380,\n",
       " 293,\n",
       " 150,\n",
       " 1104,\n",
       " 883,\n",
       " 420,\n",
       " 705,\n",
       " 215,\n",
       " 342,\n",
       " 26,\n",
       " 343,\n",
       " 52,\n",
       " 102,\n",
       " 1040,\n",
       " 75,\n",
       " 263,\n",
       " 552,\n",
       " 283,\n",
       " 1106,\n",
       " 1085,\n",
       " 674,\n",
       " 518,\n",
       " 747,\n",
       " 766,\n",
       " 323,\n",
       " 1111,\n",
       " 1081,\n",
       " 326,\n",
       " 1086,\n",
       " 1088,\n",
       " 413,\n",
       " 647,\n",
       " 443,\n",
       " 1066,\n",
       " 842,\n",
       " 376,\n",
       " 1058,\n",
       " 848,\n",
       " 849,\n",
       " 940,\n",
       " 685,\n",
       " 656,\n",
       " 548,\n",
       " 289,\n",
       " 558,\n",
       " 1052,\n",
       " 465,\n",
       " 539,\n",
       " 850,\n",
       " 821,\n",
       " 526,\n",
       " 1034,\n",
       " 1031,\n",
       " 628,\n",
       " 340,\n",
       " 761,\n",
       " 726,\n",
       " 43,\n",
       " 324,\n",
       " 244,\n",
       " 599,\n",
       " 496,\n",
       " 219,\n",
       " 57,\n",
       " 650,\n",
       " 472,\n",
       " 344,\n",
       " 101,\n",
       " 164,\n",
       " 1062,\n",
       " 14,\n",
       " 520,\n",
       " 471,\n",
       " 1033,\n",
       " 911,\n",
       " 605,\n",
       " 795,\n",
       " 805,\n",
       " 908,\n",
       " 1115,\n",
       " 831,\n",
       " 798,\n",
       " 1105,\n",
       " 401,\n",
       " 302,\n",
       " 746,\n",
       " 896,\n",
       " 782,\n",
       " 830,\n",
       " 206,\n",
       " 500,\n",
       " 800,\n",
       " 459,\n",
       " 62,\n",
       " 224,\n",
       " 504,\n",
       " 13,\n",
       " 241,\n",
       " 579,\n",
       " 5,\n",
       " 99,\n",
       " 501,\n",
       " 82,\n",
       " 659,\n",
       " 989,\n",
       " 489,\n",
       " 780,\n",
       " 1072,\n",
       " 777,\n",
       " 876,\n",
       " 690,\n",
       " 327,\n",
       " 1073,\n",
       " 372,\n",
       " 658,\n",
       " 992,\n",
       " 740,\n",
       " 281,\n",
       " 846,\n",
       " 1051,\n",
       " 1076,\n",
       " 551,\n",
       " 256,\n",
       " 542,\n",
       " 259,\n",
       " 236,\n",
       " 642,\n",
       " 511,\n",
       " 660,\n",
       " 684,\n",
       " 914,\n",
       " 352,\n",
       " 633,\n",
       " 132,\n",
       " 161,\n",
       " 630,\n",
       " 466,\n",
       " 631,\n",
       " 85,\n",
       " 718,\n",
       " 745,\n",
       " 310,\n",
       " 755,\n",
       " 860,\n",
       " 772,\n",
       " 399,\n",
       " 209,\n",
       " 1047,\n",
       " 954,\n",
       " 958,\n",
       " 270,\n",
       " 439,\n",
       " 662,\n",
       " 948,\n",
       " 318,\n",
       " 313,\n",
       " 242,\n",
       " 497,\n",
       " 412,\n",
       " 495,\n",
       " 160,\n",
       " 859,\n",
       " 384,\n",
       " 906,\n",
       " 708,\n",
       " 881,\n",
       " 200,\n",
       " 683,\n",
       " 873,\n",
       " 494,\n",
       " 645,\n",
       " 878,\n",
       " 924,\n",
       " 788,\n",
       " 194,\n",
       " 481,\n",
       " 1083,\n",
       " 245,\n",
       " 27,\n",
       " 139,\n",
       " 792,\n",
       " 503,\n",
       " 864,\n",
       " 909,\n",
       " 93,\n",
       " 221,\n",
       " 664,\n",
       " 228,\n",
       " 710,\n",
       " 956,\n",
       " 279,\n",
       " 60,\n",
       " 1097,\n",
       " 274,\n",
       " 825,\n",
       " 1098,\n",
       " 694,\n",
       " 709,\n",
       " 391,\n",
       " 354,\n",
       " 419,\n",
       " 622,\n",
       " 369,\n",
       " 566,\n",
       " 121,\n",
       " 927,\n",
       " 1119,\n",
       " 1023,\n",
       " 553,\n",
       " 935,\n",
       " 619,\n",
       " 797,\n",
       " 866,\n",
       " 1082,\n",
       " 722,\n",
       " 448,\n",
       " 931,\n",
       " 985,\n",
       " 260,\n",
       " 801,\n",
       " 918,\n",
       " 454,\n",
       " 1049,\n",
       " 681,\n",
       " 428,\n",
       " 63,\n",
       " 557,\n",
       " 1108,\n",
       " 1075,\n",
       " 776,\n",
       " 543,\n",
       " 547,\n",
       " 284,\n",
       " 386,\n",
       " 768,\n",
       " 222,\n",
       " 44,\n",
       " 785,\n",
       " 23,\n",
       " 569,\n",
       " 147,\n",
       " 670,\n",
       " 50,\n",
       " 198,\n",
       " 1054,\n",
       " 1074,\n",
       " 984,\n",
       " 208,\n",
       " 145,\n",
       " 778,\n",
       " 1022,\n",
       " 231,\n",
       " 623,\n",
       " 793,\n",
       " 863,\n",
       " 180,\n",
       " 178,\n",
       " 77,\n",
       " 696,\n",
       " 266,\n",
       " 734,\n",
       " 390,\n",
       " 1042,\n",
       " 723,\n",
       " 104,\n",
       " 195,\n",
       " 1113,\n",
       " 1101,\n",
       " 346,\n",
       " 58,\n",
       " 1093,\n",
       " 1003,\n",
       " 405,\n",
       " 952,\n",
       " 341,\n",
       " 247,\n",
       " 735,\n",
       " 48,\n",
       " 1065,\n",
       " 578,\n",
       " 478,\n",
       " 1091,\n",
       " 536,\n",
       " 426,\n",
       " 233,\n",
       " 204,\n",
       " 158,\n",
       " 502,\n",
       " 152,\n",
       " 56,\n",
       " 437,\n",
       " 385,\n",
       " 521,\n",
       " 272,\n",
       " 371,\n",
       " 802,\n",
       " 251,\n",
       " 969,\n",
       " 568,\n",
       " 589,\n",
       " 544,\n",
       " 987,\n",
       " 564,\n",
       " 967,\n",
       " 137,\n",
       " 1084,\n",
       " 258,\n",
       " 562,\n",
       " 213,\n",
       " 1015,\n",
       " 123,\n",
       " 377,\n",
       " 941,\n",
       " 1007,\n",
       " 490,\n",
       " 743,\n",
       " 1044,\n",
       " 134,\n",
       " 749,\n",
       " 353,\n",
       " 774,\n",
       " 823,\n",
       " 852,\n",
       " 249,\n",
       " 535,\n",
       " 357,\n",
       " 246,\n",
       " 887,\n",
       " 199,\n",
       " 680,\n",
       " 296,\n",
       " 728,\n",
       " 612,\n",
       " 193,\n",
       " 254,\n",
       " 357,\n",
       " 197,\n",
       " 199,\n",
       " 528,\n",
       " 535,\n",
       " 574,\n",
       " 275,\n",
       " 163,\n",
       " 423,\n",
       " 687,\n",
       " 869,\n",
       " 211,\n",
       " 306,\n",
       " 168,\n",
       " 867,\n",
       " 700,\n",
       " 763,\n",
       " 995,\n",
       " 80,\n",
       " 524,\n",
       " 1050,\n",
       " 70,\n",
       " 862,\n",
       " 598,\n",
       " 727,\n",
       " 1024,\n",
       " 720,\n",
       " 273,\n",
       " 1118,\n",
       " 253,\n",
       " 320,\n",
       " 907,\n",
       " 442,\n",
       " 529,\n",
       " 1027,\n",
       " 334,\n",
       " 220,\n",
       " 872,\n",
       " 230,\n",
       " 268,\n",
       " 1063,\n",
       " 460,\n",
       " 473,\n",
       " 16,\n",
       " 510,\n",
       " 1013,\n",
       " 775,\n",
       " 980,\n",
       " 787,\n",
       " 588,\n",
       " 577,\n",
       " 925,\n",
       " 988,\n",
       " 889,\n",
       " 560,\n",
       " 575,\n",
       " 373,\n",
       " 591,\n",
       " 149,\n",
       " 429,\n",
       " 939,\n",
       " 654,\n",
       " 752,\n",
       " 837,\n",
       " 762,\n",
       " 978,\n",
       " 651,\n",
       " 64,\n",
       " 1009,\n",
       " 977,\n",
       " 586,\n",
       " 968,\n",
       " 857,\n",
       " 667,\n",
       " 424,\n",
       " 111,\n",
       " 550,\n",
       " 190,\n",
       " 602,\n",
       " 816,\n",
       " 106,\n",
       " 183,\n",
       " 947,\n",
       " 966,\n",
       " 652,\n",
       " 95,\n",
       " 1116,\n",
       " 155,\n",
       " 146,\n",
       " 919,\n",
       " 1011,\n",
       " 991,\n",
       " 239,\n",
       " 291,\n",
       " 53,\n",
       " 809,\n",
       " 174,\n",
       " 663,\n",
       " 237,\n",
       " 321,\n",
       " 960,\n",
       " 607,\n",
       " 124,\n",
       " 345,\n",
       " 113,\n",
       " 304,\n",
       " 81,\n",
       " 729,\n",
       " 951,\n",
       " 287,\n",
       " 922,\n",
       " 7,\n",
       " 427,\n",
       " 450,\n",
       " 672,\n",
       " 901,\n",
       " 127,\n",
       " 1041,\n",
       " 899,\n",
       " 695,\n",
       " 975,\n",
       " 484,\n",
       " 884,\n",
       " 593,\n",
       " 676,\n",
       " 87,\n",
       " 893,\n",
       " 666,\n",
       " 79,\n",
       " 637,\n",
       " 488,\n",
       " 714,\n",
       " 61,\n",
       " 315,\n",
       " 751,\n",
       " 1010,\n",
       " 393,\n",
       " 285,\n",
       " 1021,\n",
       " 828,\n",
       " 1059,\n",
       " 512,\n",
       " 170,\n",
       " 844,\n",
       " 189,\n",
       " 330,\n",
       " 1017,\n",
       " 173,\n",
       " 453,\n",
       " 252,\n",
       " 383,\n",
       " 886,\n",
       " 446,\n",
       " 996,\n",
       " 698,\n",
       " 643,\n",
       " 826,\n",
       " 329,\n",
       " 843,\n",
       " 1060,\n",
       " 269,\n",
       " 108,\n",
       " 1077,\n",
       " 592,\n",
       " 114,\n",
       " 616,\n",
       " 804,\n",
       " 1071,\n",
       " 103,\n",
       " 629,\n",
       " 309,\n",
       " 583,\n",
       " 738,\n",
       " 983,\n",
       " 431,\n",
       " 112,\n",
       " 703,\n",
       " 1094,\n",
       " 620,\n",
       " 1016,\n",
       " 201,\n",
       " 641,\n",
       " 143,\n",
       " 779,\n",
       " 697,\n",
       " 744,\n",
       " 639,\n",
       " 69,\n",
       " 845,\n",
       " 485,\n",
       " 415,\n",
       " 669,\n",
       " 692,\n",
       " 171,\n",
       " 78,\n",
       " 644,\n",
       " 492,\n",
       " 416,\n",
       " 159,\n",
       " 110,\n",
       " 294,\n",
       " 555,\n",
       " 184,\n",
       " 167,\n",
       " 926,\n",
       " 37,\n",
       " 756,\n",
       " 759,\n",
       " 351,\n",
       " 808,\n",
       " 1069,\n",
       " 716,\n",
       " 1018,\n",
       " 362,\n",
       " 267,\n",
       " 1028,\n",
       " 292,\n",
       " 917,\n",
       " 32,\n",
       " 374,\n",
       " 129,\n",
       " 571,\n",
       " 425,\n",
       " 890,\n",
       " 736,\n",
       " 271,\n",
       " 874,\n",
       " 855,\n",
       " 611,\n",
       " 293,\n",
       " 499,\n",
       " 625,\n",
       " 516,\n",
       " 1045,\n",
       " 169,\n",
       " 626,\n",
       " 12,\n",
       " 8,\n",
       " 600,\n",
       " 215,\n",
       " 1099,\n",
       " 883,\n",
       " 705,\n",
       " 52,\n",
       " 6,\n",
       " 342,\n",
       " 420,\n",
       " 552,\n",
       " 102,\n",
       " 71,\n",
       " 817,\n",
       " 900,\n",
       " 572,\n",
       " 263,\n",
       " 451,\n",
       " 75,\n",
       " 518,\n",
       " 323,\n",
       " 604,\n",
       " 176,\n",
       " 565,\n",
       " 413,\n",
       " 921,\n",
       " 1087,\n",
       " 1111,\n",
       " 754,\n",
       " 1086,\n",
       " 559,\n",
       " 1002,\n",
       " 609,\n",
       " 849,\n",
       " 842,\n",
       " 685,\n",
       " 848,\n",
       " 445,\n",
       " 443,\n",
       " 436,\n",
       " 821,\n",
       " 525,\n",
       " 993,\n",
       " 682,\n",
       " 539,\n",
       " 1052,\n",
       " 526,\n",
       " 850,\n",
       " 757,\n",
       " 770,\n",
       " 835,\n",
       " 303,\n",
       " 244,\n",
       " 1031,\n",
       " 767,\n",
       " 950,\n",
       " 496,\n",
       " 942,\n",
       " 628,\n",
       " 726,\n",
       " 101,\n",
       " 344,\n",
       " 949,\n",
       " 219,\n",
       " 49,\n",
       " 216,\n",
       " 164,\n",
       " 1062,\n",
       " 57,\n",
       " 650,\n",
       " 605,\n",
       " 576,\n",
       " 311,\n",
       " 1026,\n",
       " 798,\n",
       " 1079,\n",
       " 1115,\n",
       " 332,\n",
       " 805,\n",
       " 280,\n",
       " 764,\n",
       " 206,\n",
       " 892,\n",
       " 959,\n",
       " 782,\n",
       " 903,\n",
       " 422,\n",
       " 800,\n",
       " 896,\n",
       " 394,\n",
       " 210,\n",
       " 67,\n",
       " 459,\n",
       " 885,\n",
       " 875,\n",
       " 13,\n",
       " 62,\n",
       " 241,\n",
       " 501,\n",
       " 731,\n",
       " 240,\n",
       " 355,\n",
       " 305,\n",
       " 327,\n",
       " 594,\n",
       " 464,\n",
       " 144,\n",
       " 1120,\n",
       " 438,\n",
       " 489,\n",
       " 90,\n",
       " 261,\n",
       " 658,\n",
       " 551,\n",
       " 986,\n",
       " 281,\n",
       " 316,\n",
       " 372,\n",
       " 1076,\n",
       " 1051,\n",
       " 511,\n",
       " 259,\n",
       " 18,\n",
       " 684,\n",
       " 236,\n",
       " 704,\n",
       " 456,\n",
       " 786,\n",
       " 955,\n",
       " 642,\n",
       " 630,\n",
       " 631,\n",
       " 633,\n",
       " 928,\n",
       " 161,\n",
       " 468,\n",
       " 475,\n",
       " 1068,\n",
       " 132,\n",
       " 15,\n",
       " 608,\n",
       " 1112,\n",
       " 772,\n",
       " 702,\n",
       " 209,\n",
       " 1047,\n",
       " 958,\n",
       " 89,\n",
       " 270,\n",
       " 954,\n",
       " 715,\n",
       " 94,\n",
       " 859,\n",
       " 318,\n",
       " 242,\n",
       " 581,\n",
       " 38,\n",
       " 295,\n",
       " 530,\n",
       " 412,\n",
       " 191,\n",
       " 1038,\n",
       " 1008,\n",
       " 733,\n",
       " 582,\n",
       " 881,\n",
       " 878,\n",
       " 708,\n",
       " 395,\n",
       " 645,\n",
       " 407,\n",
       " 194,\n",
       " 481,\n",
       " 338,\n",
       " 788,\n",
       " 27,\n",
       " 139,\n",
       " 573,\n",
       " 1083,\n",
       " 1110,\n",
       " 540,\n",
       " 956,\n",
       " 221,\n",
       " 182,\n",
       " 812,\n",
       " 836,\n",
       " 710,\n",
       " 664,\n",
       " 396,\n",
       " 853,\n",
       " ...]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "IR_weighting2.PopOut(topk_ratio=0.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>>>>>>MetaEvaluate Message>>>>>>>>>>>>>>>\n",
      "1121\n",
      "313\n",
      "tensor(0.4784, device='cuda:0') tensor(0.5662, device='cuda:0')\n",
      "0.6904549509366636 0.6996805111821086\n",
      "0.6996805111821086 0.6996805111821086\n",
      "0.4639830508474576 1.0\n",
      "0.5579617834394905 0.8233082706766918\n",
      "<<<<<<<<<<<<<<<<<MetaEvaluate Message<<<<<<<<<<<<\n"
     ]
    }
   ],
   "source": [
    "LogSelectionInfo(IR_weighting2, entrophy)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "#### Test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "    def FewShotDataList(self):\n",
    "        if len(self.few_shot_set) > self.max_few_shot_size:\n",
    "            few_shot_data = None\n",
    "            few_shot_data_list = [self.few_shot_set.collate_raw_batch(\n",
    "                                            [self.few_shot_set[j] for j in range(i,\n",
    "                                                                                 min(i+self.max_few_shot_size,\n",
    "                                                                                     len(self.few_shot_set)))])\n",
    "                                            for i in range(0, len(self.few_shot_set), self.max_few_shot_size)]\n",
    "        else:\n",
    "            few_shot_data = self.few_shot_set.collate_raw_batch(\n",
    "                [self.few_shot_set[i] for i in range(len(self.few_shot_set))]\n",
    "            )\n",
    "            few_shot_data_list = None\n",
    "        return few_shot_data, few_shot_data_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "few_data, few_data_list = FewShotDataList(IR_weighting2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "batch = unlabeled_set.collate_raw_batch([unlabeled_set[jj]\n",
    "                                         for jj in range(32)])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "def WeightedAcc(y_true, y_pred, weights):\n",
    "    diff = y_true - y_pred\n",
    "    diff = diff.__eq__(0).long() - diff.abs()\n",
    "    if all([w==0 for w in weights]):\n",
    "        weights += 1\n",
    "    half_high = len(weights)//2\n",
    "    topK_idx = weights.argsort()[-half_high:]\n",
    "    pos_cnt = (weights>0).sum()\n",
    "    pos_idx = (weights>0).int().argsort()[-pos_cnt:]\n",
    "    topK_acc = accuracy_score(y_true[topK_idx].cpu(), y_pred[topK_idx].cpu())\n",
    "    pos_acc = accuracy_score(y_true[pos_idx].cpu(), y_pred[pos_idx].cpu())\n",
    "    weights = weights / weights.sum()\n",
    "    return (diff*weights).sum(), topK_acc, pos_acc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(tensor(0.3125), 0.75, 0.65625)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "WeightedAcc(new_domain_label[:32].cpu(), torch.tensor(unlabeled_set.data_y).argmax(dim=1)[:32], torch.ones([32])/32.0)\n",
    "WeightedAcc(new_domain_label[:32].cpu(), torch.tensor(unlabeled_set.data_y).argmax(dim=1)[:32], torch.ones([32])/32.0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.57817476/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.\n",
      "  warnings.warn(warning.format(ret))\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.57817476/0.7200000\n",
      "-------> few shot data list ------>\n",
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.57817476/0.7200000\n",
      "-------> few shot data list ------>\n",
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.57817476/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    }
   ],
   "source": [
    "IR_weighting2.ClipValGradientV2(few_data, few_data_list, topk_ratio=0.1)\n",
    "grads10 = IR_weighting2.ComputeGrads4Weights(batch, few_data, few_data_list)\n",
    "\n",
    "IR_weighting2.ClipValGradientV2(few_data, few_data_list, topk_ratio=0.2)\n",
    "grads20 = IR_weighting2.ComputeGrads4Weights(batch, few_data, few_data_list)\n",
    "\n",
    "IR_weighting2.ClipValGradientV2(few_data, few_data_list, topk_ratio=0.5)\n",
    "grads50 = IR_weighting2.ComputeGrads4Weights(batch, few_data, few_data_list)\n",
    "\n",
    "IR_weighting2.ClipValGradientV2(few_data, few_data_list, topk_ratio=0.8)\n",
    "grads90 = IR_weighting2.ComputeGrads4Weights(batch, few_data, few_data_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------> few shot data list ------>\n",
      "####Few Shot ####, loss/acc = 0.57817476/0.7200000\n",
      "-------> few shot data list ------>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.\n",
      "  warnings.warn(warning.format(ret))\n"
     ]
    }
   ],
   "source": [
    "IR_weighting2.ClipValGradientV3(few_data, few_data_list, topk_ratio=0.1)\n",
    "grads10 = IR_weighting2.ComputeGrads4Weights(batch, few_data, few_data_list)\n",
    "\n",
    "IR_weighting2.ClipValGradientV3(few_data, few_data_list, topk_ratio=0.2)\n",
    "grads20 = IR_weighting2.ComputeGrads4Weights(batch, few_data, few_data_list)\n",
    "\n",
    "IR_weighting2.ClipValGradientV3(few_data, few_data_list, topk_ratio=0.5)\n",
    "grads50 = IR_weighting2.ComputeGrads4Weights(batch, few_data, few_data_list)\n",
    "\n",
    "IR_weighting2.ClipValGradientV3(few_data, few_data_list, topk_ratio=0.8)\n",
    "grads90 = IR_weighting2.ComputeGrads4Weights(batch, few_data, few_data_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(tensor([-15.5157,  16.3068,  -5.1153,  25.7697,  15.2517,  19.8189,  -3.4572,\n",
       "         -37.6106, -52.3762, -20.9941, -29.1696,  15.1149,  35.9184, -39.5727,\n",
       "           2.3110, -19.2959, 986.3683,   4.4722,  60.3319,  -4.9993,  -7.9442,\n",
       "          21.1381,  18.9590,   7.2420,   2.7082,  21.5779,  -5.8790,  -6.0657,\n",
       "         -19.0650,  16.3988,  52.0945,  30.1402], device='cuda:0'),\n",
       " tensor([-15.5207,  16.3051,  -5.1217,  25.7713,  15.2512,  19.8145,  -3.4561,\n",
       "         -37.6097, -52.3698, -20.9888, -29.1733,  15.1135,  35.9219, -39.5732,\n",
       "           2.3096, -19.2941, 986.3630,   4.4725,  60.3384,  -4.9977,  -7.9440,\n",
       "          21.1396,  18.9574,   7.2425,   2.7080,  21.5751,  -5.8791,  -6.0655,\n",
       "         -19.0554,  16.3975,  52.0928,  30.1400], device='cuda:0'),\n",
       " tensor([-15.8001,  16.3294,  -5.9706,  25.8798,  15.3120,  19.9414,  -3.7608,\n",
       "         -37.8992, -52.7610, -21.6600, -29.3610,  15.1578,  36.3505, -39.8870,\n",
       "           2.3575, -19.3743, 987.3425,   4.6883,  61.0052,  -5.4966,  -8.3230,\n",
       "          21.3624,  19.2543,   7.3416,   2.8181,  21.7662,  -5.9602,  -6.2186,\n",
       "         -19.4698,  16.4500,  52.5754,  30.2555], device='cuda:0'),\n",
       " tensor([-14.2119,  15.0636,  -5.5299,  23.3995,  14.0584,  18.1890,  -3.2885,\n",
       "         -35.0571, -48.6004, -19.9685, -27.3812,  14.1612,  33.1817, -36.0059,\n",
       "           2.1024, -17.7396, 904.4495,   4.1993,  57.8602,  -5.0811,  -7.6476,\n",
       "          19.7891,  17.6582,   6.8045,   2.5969,  19.7983,  -5.4513,  -5.7973,\n",
       "         -17.7494,  15.4789,  48.3256,  28.8609], device='cuda:0'))"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grads10, grads20, grads50, grads90"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(tensor([ 8, 13,  7, 10,  9, 15, 28,  0, 20, 27, 26,  2, 19,  6, 14, 24, 17, 23,\n",
       "         11,  4,  1, 29, 22,  5, 21, 25,  3, 31, 12, 30, 18, 16],\n",
       "        device='cuda:0'),\n",
       " tensor([ 8, 13,  7, 10,  9, 15, 28,  0, 20, 27, 26,  2, 19,  6, 14, 24, 17, 23,\n",
       "         11,  4,  1, 29, 22,  5, 21, 25,  3, 31, 12, 30, 18, 16],\n",
       "        device='cuda:0'),\n",
       " tensor([ 8, 13,  7, 10,  9, 28, 15,  0, 20, 27,  2, 26, 19,  6, 14, 24, 17, 23,\n",
       "         11,  4,  1, 29, 22,  5, 21, 25,  3, 31, 12, 30, 18, 16],\n",
       "        device='cuda:0'),\n",
       " tensor([ 8, 13,  7, 10,  9, 28, 15,  0, 20, 27,  2, 26, 19,  6, 14, 24, 17, 23,\n",
       "          4, 11,  1, 29, 22,  5, 21, 25,  3, 31, 12, 30, 18, 16],\n",
       "        device='cuda:0'))"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grads10.argsort(), grads20.argsort(), grads50.argsort(), grads90.argsort()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "def MetaSelfTrain(tr_model, anno_model, f_set, weak_set, weak_set_label, p_idxs, e_idxs):\n",
    "    entrophy, preds, logits = WeakLabeling(anno_model, weak_set, pseaudo_idxs=p_idxs + e_idxs)\n",
    "    idxs = expandPseaudoSet(tr_model, anno_model, weak_set, p_idxs + e_idxs, threshold=0.95)\n",
    "    p_idxs.extend(idxs)\n",
    "    trainer = MetaSelfTrainer(tr_model, weak_set, f_set, weak_set_label,\n",
    "                                 exp_idxs=e_idxs, convey_fn=None, lr4model=5e-2,\n",
    "                                   scale_lr4model=4e-2, max_few_shot_size=100, batch_size=20)\n",
    "    max_meta_steps = 10\n",
    "    if len(e_idxs)>100:\n",
    "        print(\"expand_idxs length:\", len(e_idxs))\n",
    "        trainer.ConstructExpandData(batch_size=100)\n",
    "        max_meta_steps = 5\n",
    "        \n",
    "    tmp = (trainer.lr4model, trainer.scale_lr4model)\n",
    "    trainer.lr4model, trainer.scale_lr4model = 2e-1, 1e-4\n",
    "    valid_idxs = trainer.PopOut(max_epochs=1, max_meta_steps=max_meta_steps,\n",
    "                                    lr4weights=0.02, pseaudo_idxs=pseaudo_idxs,\n",
    "                                        pop_ratio=0.2) # ferguson 上是0.1, sydney上是0.05\n",
    "    trainer.lr4model, trainer.scale_lr4model = tmp[0], tmp[1]\n",
    "    rst_model1 = Perf(tr_model, weak_set, weak_set_label)\n",
    "    print(\"%3d | %3d Post-MetaTrain Performance of model1:\", rst_model1)\n",
    "    pseaudo_labels = torch.tensor(weak_set.data_y).argmax(dim=1)\n",
    "    rst_s = acc_P_R_F1(weak_set_label[valid_idxs],\n",
    "                    pseaudo_labels[valid_idxs])\n",
    "    print(\"###Accuracy On selected instancees\", rst_s)\n",
    "    rst_p = acc_P_R_F1(weak_set_label[p_idxs],\n",
    "                       pseaudo_labels[p_idxs])\n",
    "    print(\"###Accuracy On pseaudo instances\", rst_p)\n",
    "    rst_t = acc_P_R_F1(weak_set_label[p_idxs + valid_idxs],\n",
    "                       pseaudo_labels[p_idxs + valid_idxs])\n",
    "    print(\"###Accuracy On training instances\", rst_t)\n",
    "\n",
    "    print(\"==================Global Data Selection===============>\")\n",
    "    valid_cnt = len(trainer.weak_set_weights)//5\n",
    "    valid_idxs = trainer.weak_set_weights.argsort()[-valid_cnt:].tolist()\n",
    "    rst_s = acc_P_R_F1(weak_set_label[valid_idxs],\n",
    "                       pseaudo_labels[valid_idxs])\n",
    "    print(\"###Accuracy On selected instancees\", rst_s)\n",
    "    rst_p = acc_P_R_F1(weak_set_label[p_idxs],\n",
    "                       pseaudo_labels[p_idxs])\n",
    "    print(\"###Accuracy On pseaudo instances\", rst_p)\n",
    "    rst_t = acc_P_R_F1(weak_set_label[p_idxs + valid_idxs],\n",
    "                       pseaudo_labels[p_idxs + valid_idxs])\n",
    "    print(\"###Accuracy On training instances\", rst_t)\n",
    "    return valid_idxs, p_idxs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([  -5.4811,   -3.2849,  -16.6052,  -11.3001,   -7.0365,   -7.1259,\n",
       "          24.0844,   21.1916,   -8.2320,   11.8869,  -17.3973,  -24.3811,\n",
       "         144.9813,   42.5807,  -41.2167,  154.4091,   21.9649,  -34.7818,\n",
       "         -15.4118,   32.6775,  -86.7727,   11.2608,  -51.7838,  -29.9575,\n",
       "         -39.2617,  -23.7793,  -10.4169,   19.9639,  -27.8391,  -68.4113,\n",
       "        -138.0892,  -11.8066], device='cuda:0')"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grads"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([  -6.0722,   -3.8159,  -17.3217,  -12.0239,   -7.4377,   -7.5768,\n",
       "          25.4413,   22.2692,   -8.5670,   12.7341,  -18.3701,  -26.3741,\n",
       "         150.8296,   44.4254,  -42.7099,  161.0843,   22.7558,  -36.2632,\n",
       "         -16.0801,   34.0877,  -90.1649,   11.6691,  -53.9267,  -31.4153,\n",
       "         -40.9980,  -24.9906,  -10.8673,   20.9047,  -29.1610,  -72.3526,\n",
       "        -143.1816,  -12.4842], device='cuda:0')"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grads"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "weights = grads/grads.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(tensor(0.1896), 0.8125, 0.8)"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "WeightedAcc(new_domain_label[:32], torch.tensor(unlabeled_set.data_y).argmax(dim=1)[:32], grads.cpu())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(tensor(0.1883), 0.8125, 0.8)"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "WeightedAcc(new_domain_label[:32], torch.tensor(unlabeled_set.data_y).argmax(dim=1)[:32], grads.cpu())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(tensor(0.1062), 0.7, 0.75)"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "WeightedAcc(new_domain_label[:20], torch.tensor(unlabeled_set.data_y).argmax(dim=1)[:20], grads.cpu())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(tensor(0.3125), 0.75, 0.65625)"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "WeightedAcc(new_domain_label[:32], torch.tensor(unlabeled_set.data_y).argmax(dim=1)[:32], torch.ones([32])/32)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(tensor(0.5000), 1.0, 0.75)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "WeightedAcc(new_domain_label[:20], torch.tensor(unlabeled_set.data_y).argmax(dim=1)[:20], torch.ones([20])/20)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true,
    "hidden": true
   },
   "source": [
    "##### Meta Self Train"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "self.embedding.weight.requires_grad False\n",
      "requires_grad = False\n",
      "self.emb_grad is None: True\n",
      "OOV Count: 9570\n",
      "OOV Ratio: 0.25373173900363233\n",
      "self.embedding.weight.requires_grad False\n",
      "requires_grad = False\n",
      "self.emb_grad is None: True\n",
      "OOV Count: 9570\n",
      "OOV Ratio: 0.25373173900363233\n"
     ]
    }
   ],
   "source": [
    "model1 = obtain_model(tv)\n",
    "model2 = obtain_model(tv)\n",
    "# log_dir = str(__file__).rstrip(\".py\")\n",
    "log_dir = \"Ferguson_Test\"\n",
    "if not os.path.exists(log_dir):\n",
    "    os.system(\"mkdir %s\"%log_dir)\n",
    "else:\n",
    "    os.system(\"rm -rf %s\" % log_dir)\n",
    "    os.system(\"mkdir %s\" % log_dir)\n",
    "\n",
    "\n",
    "fitlog.set_log_dir(\"%s/\" % log_dir, new_log=True)\n",
    "\n",
    "new_domain_name = new_domain.data[new_domain.data_ID[0]]['event']\n",
    "new_domain_label = torch.tensor(new_domain.data_y).argmax(dim=1)\n",
    "\n",
    "model1.load_model(BiGCN1_Paths[domain_ID])\n",
    "model2.load_model(BiGCN2_Paths[domain_ID])\n",
    "\n",
    "pseaudo_idxs = []\n",
    "unlabeled_set = new_domain"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Original Performance of model1: (0.775647171620326, (array([0.8042328, 0.5      ]), array([0.9394314 , 0.20940171]), array([0.86659065, 0.29518072]), array([809, 234])))\n",
      "Original Performance of model2: (0.7804410354745925, (array([0.79352227, 0.54545455]), array([0.96909765, 0.12820513]), array([0.87256539, 0.20761246]), array([809, 234])))\n"
     ]
    }
   ],
   "source": [
    "test_model(model1, unlabeled_set, new_domain_label, \"model1\")\n",
    "test_model(model2, unlabeled_set, new_domain_label, \"model2\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true,
    "hidden": true
   },
   "source": [
    "##### 元验证集的拟合程度较高时的数据挑选效果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "model1.load_model(\"./tmp_model1.pkl\")\n",
    "model2.load_model(\"./tmp_model2.pkl\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Original Performance of model1: (0.800575263662512, (array([0.82627579, 0.60655738]), array([0.94066749, 0.31623932]), array([0.87976879, 0.41573034]), array([809, 234])))\n",
      "Original Performance of model2: (0.8092042186001918, (array([0.83664459, 0.62773723]), array([0.93695921, 0.36752137]), array([0.88396501, 0.46361186]), array([809, 234])))\n"
     ]
    }
   ],
   "source": [
    "test_model(model1, unlabeled_set, new_domain_label, \"model1\")\n",
    "test_model(model2, unlabeled_set, new_domain_label, \"model2\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "few_shot_label = torch.tensor(few_shot_set.data_y).argmax(dim=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Original Performance of model1: (1.0, (array([1., 1.]), array([1., 1.]), array([1., 1.]), array([50, 50])))\n",
      "Original Performance of model2: (1.0, (array([1., 1.]), array([1., 1.]), array([1., 1.]), array([50, 50])))\n"
     ]
    }
   ],
   "source": [
    "test_model(model1, few_shot_set, few_shot_label, \"model1\")\n",
    "test_model(model2, few_shot_set, few_shot_label, \"model2\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.9, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.\n",
      "  warnings.warn(warning.format(ret))\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot   0 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 2.2398e-02, -1.3290e-02,  7.1915e-04,  1.8888e-02,  5.9943e-02,\n",
      "         4.0633e-04,  3.6238e-03,  2.0006e-03,  2.2794e-03,  4.0262e-04,\n",
      "         1.1343e-05,  1.2669e-03,  3.7995e-04, -9.9320e-02, -5.7810e-02,\n",
      "         4.8025e-04,  4.5491e-03,  4.4574e-03,  1.5234e-02,  2.1713e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.00115150/1.0000000\n",
      "grad_weights: tensor([ 1.4209e-02, -7.7333e-03,  1.5645e-04,  1.1233e-02,  5.5598e-02,\n",
      "         2.0401e-04,  2.6928e-03,  1.1095e-03,  1.4425e-03,  1.7817e-04,\n",
      "         3.5117e-06,  8.3177e-04,  2.2333e-04, -4.1190e-02, -2.4066e-02,\n",
      "         2.5969e-04,  2.6043e-03,  2.6219e-03,  8.9953e-03,  2.5021e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.00111245/1.0000000\n",
      "grad_weights: tensor([ 6.0983e-04, -3.1550e-03, -3.8791e-04,  3.2639e-03,  2.0032e-02,\n",
      "        -7.5213e-05,  5.9153e-04,  1.1458e-05,  1.2469e-04, -1.0685e-04,\n",
      "        -5.4140e-06,  1.0715e-04, -5.8520e-05, -5.0470e-03, -4.9455e-03,\n",
      "         3.6678e-06, -2.4223e-04,  4.3470e-04,  4.2702e-04, -1.8746e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.00112405/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3664, device='cuda:1'), 0.8, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-11.9524,  12.3002,  -9.0694, -12.2020, -12.7148, -11.1090, -12.3555,\n",
      "        -11.7597, -12.0069, -10.7145,  -8.7197, -12.0995, -11.3807,  11.5475,\n",
      "         11.6351, -11.7143, -11.6506, -12.0351, -11.8845,  -7.7459],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.8, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 1.2773e-03,  5.1923e-04,  2.4540e-03,  1.4821e-02,  1.9351e-05,\n",
      "         3.7636e-03,  1.1201e-01,  1.8357e-03,  1.5534e-02,  3.2685e-03,\n",
      "         1.3147e-03, -7.0304e-02, -1.6133e-02,  1.5205e-02,  6.8038e-03,\n",
      "        -1.7032e-02,  7.9135e-04, -7.3729e-02,  8.2784e-03,  5.2872e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.00119906/1.0000000\n",
      "grad_weights: tensor([ 1.0131e-03,  4.1645e-04,  1.7861e-03,  1.2505e-02,  1.2871e-05,\n",
      "         3.2985e-03,  1.0834e-01,  1.4839e-03,  1.1954e-02,  3.1176e-03,\n",
      "         9.4471e-04, -5.3700e-02, -1.1143e-02,  1.5294e-02,  6.0660e-03,\n",
      "        -1.2716e-02,  6.8654e-04, -5.2571e-02,  7.8761e-03,  4.4511e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.00115691/1.0000000\n",
      "grad_weights: tensor([ 7.4884e-04,  2.9303e-04,  1.0883e-03,  1.0157e-02,  6.0692e-06,\n",
      "         2.7264e-03,  9.7406e-02,  1.0853e-03,  8.3808e-03,  2.8161e-03,\n",
      "         5.5395e-04, -3.9199e-02, -7.3706e-03,  1.4123e-02,  5.0468e-03,\n",
      "        -8.8494e-03,  5.3688e-04, -3.5664e-02,  7.1125e-03,  3.5399e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.00112714/1.0000000\n",
      "grad_weights: tensor([ 4.8626e-04,  1.4771e-04,  3.5642e-04,  7.7547e-03, -9.9057e-07,\n",
      "         2.0335e-03,  7.7977e-02,  6.3838e-04,  4.7663e-03,  2.3101e-03,\n",
      "         1.4604e-04, -2.6731e-02, -4.5607e-03,  1.1177e-02,  3.7213e-03,\n",
      "        -5.3932e-03,  3.3698e-04, -2.2539e-02,  5.8361e-03,  2.5681e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.00110902/1.0000000\n",
      "grad_weights: tensor([ 2.2194e-04, -2.1901e-05, -4.0350e-04,  5.3332e-03, -8.3300e-06,\n",
      "         1.2175e-03,  5.0959e-02,  1.3846e-04,  1.1393e-03,  1.5528e-03,\n",
      "        -2.8050e-04, -1.5901e-02, -2.4675e-03,  5.9381e-03,  2.0221e-03,\n",
      "        -2.3110e-03,  9.8559e-05, -1.2506e-02,  3.9684e-03,  1.5231e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.00110137/1.0000000\n",
      "grad_weights: tensor([-3.8091e-05, -2.1667e-04, -1.1892e-03,  2.9077e-03, -1.5852e-05,\n",
      "         3.4009e-04,  1.7030e-02, -4.0760e-04, -2.4429e-03,  5.0135e-04,\n",
      "        -7.1831e-04, -6.7252e-03, -9.3479e-04, -2.1705e-03, -5.1654e-05,\n",
      "         4.3357e-04, -2.3102e-04, -4.9363e-03,  1.4181e-03,  4.2669e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.00110212/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4788, device='cuda:1'), 0.9, 0.75)\n",
      "=====> Optimized weights: tensor([-7.9186, -7.3558, -6.8630, -8.3091, -5.4292, -8.2633, -8.4496, -7.6966,\n",
      "        -7.6550, -8.4610, -6.6775,  8.0119,  7.7411, -8.3114, -8.2119,  7.7826,\n",
      "        -7.8144,  7.8165, -8.4704, -8.1884], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([-6.8410e-02, -4.3450e-02,  2.3227e-02,  2.9520e-02,  5.0185e-04,\n",
      "         2.0881e-03,  2.1663e-02,  6.2218e-04,  1.6264e-04,  1.1303e-02,\n",
      "        -2.2991e-02, -2.5479e-02,  4.9803e-03,  4.8217e-01,  1.9177e-03,\n",
      "         5.6181e-03,  3.5083e-03, -4.3138e-02,  1.9622e-02, -5.7921e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00121329/1.0000000\n",
      "grad_weights: tensor([-5.5837e-02, -3.5866e-02,  2.0435e-02,  2.6329e-02,  4.4663e-04,\n",
      "         1.7043e-03,  1.9130e-02,  5.1678e-04,  1.8162e-04,  9.6742e-03,\n",
      "        -1.8572e-02, -2.0554e-02,  4.4826e-03,  4.2289e-01,  1.5821e-03,\n",
      "         5.1636e-03,  3.1401e-03, -3.5441e-02,  1.7790e-02, -4.2552e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00117952/1.0000000\n",
      "grad_weights: tensor([-4.4600e-02, -2.8958e-02,  1.7663e-02,  2.2690e-02,  3.8142e-04,\n",
      "         1.3286e-03,  1.6332e-02,  4.1071e-04,  1.9491e-04,  8.0779e-03,\n",
      "        -1.4510e-02, -1.6048e-02,  3.9139e-03,  3.5943e-01,  1.2233e-03,\n",
      "         4.6072e-03,  2.7597e-03, -2.8290e-02,  1.5631e-02, -3.0501e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00115266/1.0000000\n",
      "grad_weights: tensor([-3.4891e-02, -2.2703e-02,  1.4366e-02,  1.8570e-02,  3.0414e-04,\n",
      "         9.5245e-04,  1.3157e-02,  3.0276e-04,  1.9092e-04,  6.5281e-03,\n",
      "        -1.0707e-02, -1.1857e-02,  3.2458e-03,  2.9300e-01,  8.3650e-04,\n",
      "         3.9396e-03,  2.3441e-03, -2.1728e-02,  1.3096e-02, -2.0998e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00113246/1.0000000\n",
      "grad_weights: tensor([-2.6189e-02, -1.7250e-02,  1.0857e-02,  1.4033e-02,  2.1562e-04,\n",
      "         5.8411e-04,  9.6985e-03,  1.9484e-04,  1.6009e-04,  4.9591e-03,\n",
      "        -7.2307e-03, -8.0345e-03,  2.4980e-03,  2.2570e-01,  4.2824e-04,\n",
      "         3.1661e-03,  1.8920e-03, -1.5781e-02,  1.0214e-02, -1.3776e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00111858/1.0000000\n",
      "grad_weights: tensor([-1.8612e-02, -1.2143e-02,  7.0838e-03,  9.0257e-03,  1.1384e-04,\n",
      "         2.1948e-04,  5.9194e-03,  8.6702e-05,  8.4754e-05,  3.4031e-03,\n",
      "        -4.0227e-03, -4.5281e-03,  1.6483e-03,  1.5851e-01,  2.3040e-07,\n",
      "         2.2726e-03,  1.3993e-03, -1.0246e-02,  6.9204e-03, -8.2877e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00111055/1.0000000\n",
      "grad_weights: tensor([-1.2063e-02, -7.5765e-03,  3.0896e-03,  3.5795e-03, -8.1405e-07,\n",
      "        -1.3714e-04,  1.8475e-03, -2.1176e-05, -5.2234e-05,  1.8753e-03,\n",
      "        -1.0814e-03, -1.3277e-03,  7.0652e-04,  9.2518e-02, -4.5771e-04,\n",
      "         1.2677e-03,  8.7310e-04, -5.2093e-03,  3.2417e-03, -4.1885e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00110763/1.0000000\n",
      "grad_weights: tensor([-0.0065, -0.0036, -0.0010, -0.0022, -0.0001, -0.0005, -0.0024, -0.0001,\n",
      "        -0.0003,  0.0004,  0.0016,  0.0015, -0.0003,  0.0294, -0.0009,  0.0002,\n",
      "         0.0003, -0.0007, -0.0007, -0.0012], device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00110876/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.2043, device='cuda:1'), 0.8, 0.8333333333333334)\n",
      "=====> Optimized weights: tensor([ 3.6703,  3.6793, -3.7046, -3.7012, -3.5891, -3.4246, -3.6646, -3.4766,\n",
      "        -3.5446, -3.7051,  3.5356,  3.5395, -3.7249, -3.7375, -3.2388, -3.7955,\n",
      "        -3.7982,  3.6259, -3.7474,  3.4511], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.7, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot  60 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0569,  0.0084,  0.0061,  0.0083,  0.0023,  0.0005,  0.0303,  0.0091,\n",
      "         0.0042,  0.0091,  0.0040,  0.0150,  0.0017,  0.0002, -0.0615, -0.0124,\n",
      "         0.0256, -0.0152,  0.0096,  0.0154], device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.00122339/1.0000000\n",
      "grad_weights: tensor([ 0.0531,  0.0077,  0.0056,  0.0079,  0.0021,  0.0005,  0.0282,  0.0083,\n",
      "         0.0037,  0.0082,  0.0037,  0.0136,  0.0017,  0.0002, -0.0530, -0.0112,\n",
      "         0.0234, -0.0132,  0.0092,  0.0142], device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.00119661/1.0000000\n",
      "grad_weights: tensor([ 0.0485,  0.0070,  0.0051,  0.0073,  0.0019,  0.0005,  0.0260,  0.0076,\n",
      "         0.0032,  0.0074,  0.0034,  0.0122,  0.0016,  0.0002, -0.0450, -0.0099,\n",
      "         0.0210, -0.0113,  0.0087,  0.0130], device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.00117367/1.0000000\n",
      "grad_weights: tensor([ 0.0435,  0.0063,  0.0046,  0.0066,  0.0016,  0.0005,  0.0236,  0.0067,\n",
      "         0.0026,  0.0065,  0.0031,  0.0108,  0.0015,  0.0001, -0.0376, -0.0088,\n",
      "         0.0186, -0.0096,  0.0081,  0.0118], device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.00115454/1.0000000\n",
      "grad_weights: tensor([ 0.0376,  0.0055,  0.0040,  0.0057,  0.0014,  0.0004,  0.0207,  0.0057,\n",
      "         0.0021,  0.0056,  0.0027,  0.0093,  0.0013,  0.0001, -0.0308, -0.0077,\n",
      "         0.0160, -0.0079,  0.0074,  0.0105], device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.00113913/1.0000000\n",
      "grad_weights: tensor([ 3.1256e-02,  4.7035e-03,  3.5095e-03,  4.9121e-03,  1.0926e-03,\n",
      "         3.4973e-04,  1.7704e-02,  4.7865e-03,  1.5093e-03,  4.6684e-03,\n",
      "         2.3506e-03,  7.6951e-03,  1.0918e-03,  7.4173e-05, -2.4649e-02,\n",
      "        -6.6348e-03,  1.3448e-02, -6.3716e-03,  6.4960e-03,  9.1775e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.00112729/1.0000000\n",
      "grad_weights: tensor([ 2.4691e-02,  3.8547e-03,  2.8688e-03,  3.6669e-03,  7.8492e-04,\n",
      "         2.8090e-04,  1.4359e-02,  3.7562e-03,  9.0992e-04,  3.7116e-03,\n",
      "         1.9583e-03,  6.0340e-03,  7.9739e-04,  4.2457e-05, -1.8950e-02,\n",
      "        -5.6196e-03,  1.0775e-02, -4.9440e-03,  5.4220e-03,  7.7810e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.00111887/1.0000000\n",
      "grad_weights: tensor([ 1.7819e-02,  2.9814e-03,  2.2000e-03,  2.2302e-03,  4.5523e-04,\n",
      "         2.0167e-04,  1.0723e-02,  2.6577e-03,  2.9536e-04,  2.7859e-03,\n",
      "         1.5485e-03,  4.3173e-03,  4.6114e-04,  1.0540e-05, -1.3724e-02,\n",
      "        -4.7808e-03,  7.9705e-03, -3.6167e-03,  4.1770e-03,  6.3506e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.00111361/1.0000000\n",
      "grad_weights: tensor([ 9.8219e-03,  2.0796e-03,  1.5191e-03,  5.9216e-04,  1.0853e-04,\n",
      "         1.1097e-04,  6.8346e-03,  1.5165e-03, -3.3547e-04,  1.8585e-03,\n",
      "         1.1254e-03,  2.5642e-03,  1.6803e-05, -2.1634e-05, -8.9592e-03,\n",
      "        -3.9056e-03,  5.0924e-03, -2.3988e-03,  2.7586e-03,  4.8747e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.00111118/1.0000000\n",
      "grad_weights: tensor([ 1.6374e-03,  1.1697e-03,  8.1593e-04, -1.2018e-03, -2.4836e-04,\n",
      "         9.5761e-06,  2.7955e-03,  3.6048e-04, -9.6917e-04,  9.4680e-04,\n",
      "         6.9573e-04,  8.0624e-04, -4.9645e-04, -5.3796e-05, -4.7047e-03,\n",
      "        -3.0976e-03,  2.2247e-03, -1.2940e-03,  1.1904e-03,  3.4167e-03],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(-0.7964, device='cuda:1'), 0.7, 0.0)\n",
      "=====> Optimized weights: tensor([-10.1826, -10.2754, -10.2997, -10.0941,  -9.8738, -10.2993, -10.2876,\n",
      "        -10.1370,  -9.4422, -10.1627, -10.3393, -10.1234, -10.0760,  -9.2991,\n",
      "          9.8665,  10.3118, -10.1748,   9.9238, -10.4515, -10.3987],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.5, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0005, -0.0353,  0.0006,  0.0173,  0.0058,  0.0026, -0.0047, -0.0358,\n",
      "         0.0014,  0.0137,  0.0009,  0.0435,  0.0020,  0.0245,  0.0003,  0.0045,\n",
      "         0.0011,  0.0002,  0.0017,  0.0016], device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.00117341/1.0000000\n",
      "grad_weights: tensor([ 0.0002, -0.0214,  0.0004,  0.0160,  0.0042,  0.0019, -0.0028, -0.0212,\n",
      "         0.0008,  0.0106,  0.0008,  0.0365,  0.0015,  0.0221,  0.0002,  0.0034,\n",
      "         0.0009,  0.0001,  0.0014,  0.0011], device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.00112836/1.0000000\n",
      "grad_weights: tensor([-8.4927e-05, -1.0542e-02,  1.5999e-04,  1.0363e-02,  1.9916e-03,\n",
      "         1.1320e-03, -1.4539e-03, -9.1757e-03,  2.6148e-04,  6.4223e-03,\n",
      "         5.0685e-04,  2.2804e-02,  6.8174e-04,  1.4905e-02, -2.6888e-05,\n",
      "         1.6383e-03,  5.7282e-04,  4.0483e-05,  6.9332e-04,  4.7081e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.00111607/1.0000000\n",
      "grad_weights: tensor([-0.0004, -0.0020, -0.0001, -0.0026, -0.0010,  0.0001, -0.0004,  0.0013,\n",
      "        -0.0004,  0.0008, -0.0002, -0.0006, -0.0005,  0.0005, -0.0003, -0.0015,\n",
      "        -0.0001, -0.0001, -0.0006, -0.0004], device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.00112803/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6034, device='cuda:1'), 0.7, 0.3333333333333333)\n",
      "=====> Optimized weights: tensor([-12.8225,  17.8481, -17.0190, -18.3906, -17.6093, -18.3996,  17.9603,\n",
      "         17.4600, -16.5606, -18.5250, -18.0949, -18.5213, -17.4297, -18.7481,\n",
      "        -13.6835, -17.3175, -18.2620, -15.9828, -17.4313, -17.1743],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.8, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([0.0003, 0.0005, 0.0172, 0.0008, 0.0021, 0.0014, 0.0659, 0.0060, 0.0011,\n",
      "        0.0002, 0.0003, 0.0008, 0.0418, 0.0181, 0.0205, 0.0070, 0.0010, 0.0125,\n",
      "        0.0131, 0.0386], device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.00116303/1.0000000\n",
      "grad_weights: tensor([ 2.0910e-04,  3.3915e-04,  1.0224e-02,  6.8371e-04,  1.5612e-03,\n",
      "         9.9873e-04,  5.0318e-02,  3.3250e-03,  5.8840e-04,  1.3152e-04,\n",
      "        -2.2450e-05,  5.0068e-04,  3.5858e-02,  1.1936e-02,  1.4182e-02,\n",
      "         4.2916e-03,  7.1003e-04,  6.5669e-03,  8.1808e-03,  2.3504e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.00112177/1.0000000\n",
      "grad_weights: tensor([ 6.3996e-06,  7.5316e-05,  2.1756e-03,  3.3369e-04,  5.1410e-04,\n",
      "         3.9267e-04,  2.4643e-02, -4.2631e-04,  2.5481e-05,  1.6738e-05,\n",
      "        -3.6340e-04,  7.7843e-05,  1.4588e-02,  1.3181e-03,  7.6059e-03,\n",
      "         1.2515e-03,  2.1860e-04,  1.9608e-04,  2.9785e-03,  7.4291e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.00112386/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6890, device='cuda:1'), 0.9, 0.85)\n",
      "=====> Optimized weights: tensor([-12.6715, -12.9403, -12.8785, -13.5493, -13.2717, -13.3482, -13.5143,\n",
      "        -12.3092, -12.5367, -12.8713,  -6.4356, -12.8076, -13.5299, -12.8602,\n",
      "        -13.4502, -13.0207, -13.1645, -12.4800, -13.1351, -13.0427],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.6, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0350, -0.0539,  0.0003,  0.0099,  0.0006,  0.0044,  0.0282,  0.0059,\n",
      "         0.0445,  0.0267, -0.1840,  0.0209,  0.0005,  0.0007,  0.0018,  0.0018,\n",
      "         0.0016,  0.0003,  0.0186,  0.0019], device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.00117126/1.0000000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "grad_weights: tensor([ 0.0254, -0.0306,  0.0002,  0.0067,  0.0004,  0.0034,  0.0218,  0.0045,\n",
      "         0.0328,  0.0219, -0.1015,  0.0137,  0.0003,  0.0004,  0.0013,  0.0015,\n",
      "         0.0011,  0.0002,  0.0139,  0.0007], device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.00112505/1.0000000\n",
      "grad_weights: tensor([ 1.3105e-02, -1.3953e-02,  1.1384e-04,  2.9259e-03,  2.2363e-04,\n",
      "         1.9134e-03,  1.2021e-02,  2.6369e-03,  2.0100e-02,  1.2531e-02,\n",
      "        -4.4422e-02,  5.2996e-03,  1.5065e-04,  1.1941e-04,  5.8725e-04,\n",
      "         8.3665e-04,  4.8845e-04, -1.9614e-05,  7.6024e-03, -4.7402e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.00111122/1.0000000\n",
      "grad_weights: tensor([-1.7387e-03, -2.6169e-03, -3.7766e-05, -1.3647e-03,  9.4101e-06,\n",
      "        -3.3366e-04, -1.4322e-03,  1.7923e-04,  6.6512e-03, -2.0840e-03,\n",
      "        -6.2851e-03, -4.3746e-03, -5.0340e-05, -2.0854e-04, -5.8041e-04,\n",
      "        -1.5839e-04, -4.3932e-04, -2.4053e-04, -3.6448e-04, -1.7442e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.00112058/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3884, device='cuda:1'), 0.8, 1.0)\n",
      "=====> Optimized weights: tensor([-8.2851,  8.1032, -8.1622, -8.0463, -8.3343, -8.3566, -8.3679, -8.4662,\n",
      "        -8.5685, -8.3980,  8.0416, -7.8743, -8.1065, -7.5402, -7.9151, -8.3859,\n",
      "        -7.9143, -6.2743, -8.3677, -5.4648], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.7, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 8.1225e-03, -2.5716e-01,  1.2779e-03,  3.5792e-02, -4.5033e-02,\n",
      "         2.8532e-05,  3.0239e-04, -6.1537e-02,  7.3490e-04, -1.4998e-02,\n",
      "         8.9052e-02,  2.6468e-03,  8.8076e-03,  3.6444e-04,  8.2244e-03,\n",
      "         1.0594e-02,  8.2222e-03, -4.7358e-02, -5.0853e-02,  8.1683e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.00118352/1.0000000\n",
      "grad_weights: tensor([ 6.1890e-03, -1.4186e-01,  9.0177e-04,  3.6310e-02, -2.7414e-02,\n",
      "         1.9517e-05,  2.4339e-04, -4.1076e-02,  5.5430e-04, -9.8766e-03,\n",
      "         7.0553e-02,  2.3719e-03,  7.0553e-03,  2.0809e-04,  7.2211e-03,\n",
      "         7.7843e-03,  5.6459e-03, -3.5222e-02, -3.1504e-02,  6.6721e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.00113869/1.0000000\n",
      "grad_weights: tensor([ 3.9777e-03, -6.1220e-02,  5.0176e-04,  3.0588e-02, -1.4631e-02,\n",
      "         1.0035e-05,  1.4668e-04, -2.4282e-02,  3.6488e-04, -5.7627e-03,\n",
      "         4.6062e-02,  1.6078e-03,  4.8192e-03,  5.2639e-05,  5.3202e-03,\n",
      "         4.2714e-03,  2.8847e-03, -2.4137e-02, -1.5854e-02,  4.7953e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.00111721/1.0000000\n",
      "grad_weights: tensor([ 1.5181e-03, -1.4403e-02,  8.2232e-05,  1.6553e-02, -5.6195e-03,\n",
      "         1.3077e-07,  3.2814e-06, -1.0711e-02,  1.6784e-04, -2.5141e-03,\n",
      "         1.6461e-02,  1.4380e-04,  2.1090e-03, -1.1798e-04,  2.3866e-03,\n",
      "         5.7026e-05,  3.0252e-05, -1.4558e-02, -3.4726e-03,  2.5938e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.00111497/1.0000000\n",
      "grad_weights: tensor([-1.1046e-03,  9.7192e-03, -3.5386e-04, -8.9593e-03,  7.3189e-04,\n",
      "        -1.0116e-05, -1.9282e-04,  9.8611e-05, -3.5124e-05,  1.0187e-04,\n",
      "        -1.6706e-02, -2.2277e-03, -1.1071e-03, -2.9266e-04, -1.6633e-03,\n",
      "        -4.8440e-03, -2.9679e-03, -6.3555e-03,  6.3381e-03,  1.1808e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.00112540/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.2802, device='cuda:1'), 0.8, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-5.0206,  4.6598, -4.7575, -5.2650,  4.8577, -4.4165, -4.6007,  4.9887,\n",
      "        -5.0875,  4.9696, -5.0152, -4.6482, -5.1001, -3.7081, -5.1452, -4.6261,\n",
      "        -4.6138,  5.2294,  4.7417, -5.2316], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 1.8611e-04,  2.5001e-03,  1.4036e-02,  2.3848e-04,  1.0507e-03,\n",
      "         1.0505e-02,  1.4888e-04,  8.0805e-03,  3.2000e-03,  6.4619e-04,\n",
      "         2.1161e-03,  2.8584e-04,  5.9913e-05,  3.2692e-03,  7.1801e-04,\n",
      "         9.1609e-03,  5.2149e-02,  4.5167e-03, -1.9595e-01,  2.1831e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.00115468/1.0000000\n",
      "grad_weights: tensor([ 4.7487e-05,  1.2589e-03,  9.8027e-03,  1.3620e-04,  6.5477e-04,\n",
      "         6.1303e-03,  1.1406e-04,  4.5274e-03,  1.2617e-03,  3.6393e-04,\n",
      "         1.1617e-03,  1.5249e-04,  3.5896e-05,  2.1067e-03,  2.8081e-04,\n",
      "         6.2901e-03,  2.9684e-02,  3.8554e-03, -8.8228e-02,  1.2475e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.00111980/1.0000000\n",
      "grad_weights: tensor([-1.2626e-04, -3.1745e-04,  9.5202e-04, -1.2564e-04, -7.1569e-06,\n",
      "         1.6516e-03,  2.0574e-05, -4.4642e-04, -1.0655e-03,  2.4159e-05,\n",
      "        -2.2619e-04, -2.3862e-05, -1.0377e-05,  6.7323e-04, -1.9931e-04,\n",
      "         4.4814e-04,  4.1268e-03, -1.4047e-04, -1.3904e-02, -1.9755e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.00113403/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.7878, device='cuda:1'), 0.9, 0.0)\n",
      "=====> Optimized weights: tensor([ -8.0294, -10.3064, -11.0542,  -9.3678, -10.7972, -11.0804, -11.1562,\n",
      "        -10.5973,  -9.4722, -10.7917, -10.4481, -10.4365, -10.1781, -11.2415,\n",
      "         -9.6032, -11.0040, -10.9090, -10.9765,  10.6592, -10.5345],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154]\n",
      "=====> init acc: (tensor(0.2000, device='cuda:1'), 0.8, 0.6)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0003,  0.0057,  0.0015,  0.0158,  0.0188, -0.0210,  0.0095, -0.0575,\n",
      "         0.0338,  0.0055,  0.0187,  0.0460,  0.0031,  0.0008,  0.0018,  0.0121,\n",
      "         0.1324,  0.0413,  0.0761,  0.1687], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.00121523/1.0000000\n",
      "grad_weights: tensor([ 0.0003,  0.0050,  0.0013,  0.0149,  0.0166, -0.0172,  0.0088, -0.0456,\n",
      "         0.0387,  0.0047,  0.0156,  0.0400,  0.0028,  0.0007,  0.0016,  0.0105,\n",
      "         0.1174,  0.0363,  0.0720,  0.1625], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.00118354/1.0000000\n",
      "grad_weights: tensor([ 0.0002,  0.0042,  0.0012,  0.0136,  0.0141, -0.0139,  0.0078, -0.0350,\n",
      "         0.0427,  0.0039,  0.0124,  0.0331,  0.0025,  0.0006,  0.0014,  0.0090,\n",
      "         0.0993,  0.0304,  0.0658,  0.1501], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.00115889/1.0000000\n",
      "grad_weights: tensor([ 1.0106e-04,  3.2038e-03,  9.5580e-04,  1.1830e-02,  1.1384e-02,\n",
      "        -1.0947e-02,  6.7070e-03, -2.6046e-02,  4.5332e-02,  3.1182e-03,\n",
      "         8.9010e-03,  2.5175e-02,  2.0586e-03,  5.4554e-04,  1.0924e-03,\n",
      "         7.3966e-03,  7.8607e-02,  2.3929e-02,  5.7036e-02,  1.2958e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.00114113/1.0000000\n",
      "grad_weights: tensor([ 1.8738e-05,  2.1152e-03,  7.3807e-04,  9.4356e-03,  8.4194e-03,\n",
      "        -8.3688e-03,  5.3590e-03, -1.8084e-02,  4.4337e-02,  2.3433e-03,\n",
      "         5.3046e-03,  1.6478e-02,  1.5402e-03,  4.5226e-04,  8.0653e-04,\n",
      "         5.8622e-03,  5.5913e-02,  1.6714e-02,  4.6039e-02,  1.0220e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.00112999/1.0000000\n",
      "grad_weights: tensor([-6.3738e-05,  8.8683e-04,  5.0033e-04,  6.4881e-03,  5.2025e-03,\n",
      "        -6.0956e-03,  3.7698e-03, -1.1169e-02,  3.8441e-02,  1.5732e-03,\n",
      "         1.4536e-03,  6.8213e-03,  9.0628e-04,  3.4346e-04,  4.9062e-04,\n",
      "         4.3517e-03,  3.1063e-02,  8.7095e-03,  3.1719e-02,  6.8822e-02],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 180 | 993 ####, loss/acc = 0.00112505/1.0000000\n",
      "grad_weights: tensor([-0.0001, -0.0005,  0.0002,  0.0027,  0.0018, -0.0041,  0.0019, -0.0052,\n",
      "         0.0262,  0.0008, -0.0025, -0.0036,  0.0002,  0.0002,  0.0001,  0.0029,\n",
      "         0.0047,  0.0002,  0.0147,  0.0310], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.00112530/1.0000000\n",
      "=====> Optimized acc: (tensor(0.0112, device='cuda:1'), 0.7, 1.0)\n",
      "=====> Optimized weights: tensor([-3.4783, -4.0291, -4.1734, -4.2394, -4.1344,  4.1119, -4.2270,  4.0044,\n",
      "        -4.4293, -4.1303, -3.9231, -4.0190, -4.1602, -4.2565, -4.1256, -4.1870,\n",
      "        -4.1027, -4.0806, -4.2452, -4.2438], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350]\n",
      "reset tmp model\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0156,  0.0164, -0.0039,  0.0115,  0.0346,  0.0027,  0.0647,  0.0004,\n",
      "         0.0020,  0.0003,  0.0215,  0.0004,  0.0146,  0.0034,  0.0201,  0.0002,\n",
      "         0.0204,  0.0065,  0.0007,  0.0016], device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.00119992/1.0000000\n",
      "grad_weights: tensor([ 0.0130,  0.0144, -0.0031,  0.0096,  0.0291,  0.0024,  0.0585,  0.0004,\n",
      "         0.0016,  0.0002,  0.0225,  0.0004,  0.0120,  0.0027,  0.0164,  0.0001,\n",
      "         0.0184,  0.0054,  0.0006,  0.0012], device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.00115987/1.0000000\n",
      "grad_weights: tensor([ 9.9764e-03,  1.1875e-02, -2.3930e-03,  7.3607e-03,  2.3070e-02,\n",
      "         1.9898e-03,  4.8846e-02,  3.0504e-04,  1.0953e-03,  1.5176e-04,\n",
      "         2.1283e-02,  2.9694e-04,  9.1577e-03,  1.8824e-03,  1.2391e-02,\n",
      "         7.1466e-05,  1.5093e-02,  3.9211e-03,  4.9252e-04,  7.9987e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.00113355/1.0000000\n",
      "grad_weights: tensor([ 6.1817e-03,  9.0658e-03, -1.7422e-03,  4.7252e-03,  1.6404e-02,\n",
      "         1.3870e-03,  3.5981e-02,  2.2616e-04,  5.1934e-04,  8.8985e-05,\n",
      "         1.6445e-02,  1.7961e-04,  5.9904e-03,  1.0351e-03,  7.8942e-03,\n",
      "         5.9175e-06,  1.0245e-02,  2.2085e-03,  3.0230e-04,  3.8167e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.00112036/1.0000000\n",
      "grad_weights: tensor([ 1.7569e-03,  5.1020e-03, -1.1628e-03,  1.6263e-03,  9.0362e-03,\n",
      "         5.4274e-04,  1.9229e-02,  1.2793e-04, -1.6974e-04,  2.2727e-05,\n",
      "         6.1777e-03,  1.2327e-05,  2.6179e-03,  4.0787e-05,  2.8957e-03,\n",
      "        -6.5936e-05,  3.4644e-03,  2.2808e-04,  5.0889e-05, -4.0384e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.00111922/1.0000000\n",
      "grad_weights: tensor([-3.6318e-03,  1.5468e-04, -6.5890e-04, -2.0080e-03,  1.1815e-03,\n",
      "        -5.9734e-04, -1.6596e-03,  1.1035e-05, -9.5650e-04, -4.6980e-05,\n",
      "        -1.1468e-02, -2.1694e-04, -1.3869e-03, -1.0414e-03, -2.7422e-03,\n",
      "        -1.4549e-04, -5.6330e-03, -2.2294e-03, -2.6403e-04, -4.7530e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.00112619/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5880, device='cuda:1'), 0.9, 1.0)\n",
      "=====> Optimized weights: tensor([-13.4583, -14.1949,  14.0905, -13.5844, -14.0410, -13.8265, -14.1652,\n",
      "        -14.1557, -12.5112, -13.2268, -13.9320, -13.0940, -13.7057, -12.9565,\n",
      "        -13.5749, -10.6033, -13.7175, -13.0861, -13.3045, -12.6349],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.9, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0498,  0.0070, -0.0291, -0.1461,  0.0008,  0.0002,  0.0681,  0.0266,\n",
      "         0.0377,  0.0456,  0.0002, -0.0689,  0.0041,  0.0190,  0.0082,  0.0007,\n",
      "        -0.0397,  0.0222,  0.0126,  0.0513], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00122679/1.0000000\n",
      "grad_weights: tensor([ 0.0478,  0.0065, -0.0251, -0.1280,  0.0007,  0.0002,  0.0625,  0.0254,\n",
      "         0.0350,  0.0431,  0.0002, -0.0551,  0.0040,  0.0185,  0.0077,  0.0006,\n",
      "        -0.0354,  0.0210,  0.0115,  0.0491], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00120257/1.0000000\n",
      "grad_weights: tensor([ 0.0455,  0.0059, -0.0215, -0.1109,  0.0006,  0.0002,  0.0567,  0.0242,\n",
      "         0.0322,  0.0403,  0.0002, -0.0434,  0.0039,  0.0179,  0.0070,  0.0005,\n",
      "        -0.0313,  0.0196,  0.0104,  0.0465], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00118137/1.0000000\n",
      "grad_weights: tensor([ 0.0427,  0.0053, -0.0182, -0.0949,  0.0006,  0.0002,  0.0506,  0.0226,\n",
      "         0.0292,  0.0370,  0.0001, -0.0337,  0.0037,  0.0169,  0.0064,  0.0005,\n",
      "        -0.0273,  0.0180,  0.0092,  0.0435], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00116320/1.0000000\n",
      "grad_weights: tensor([ 0.0395,  0.0046, -0.0152, -0.0800,  0.0005,  0.0001,  0.0439,  0.0206,\n",
      "         0.0261,  0.0341,  0.0001, -0.0260,  0.0035,  0.0158,  0.0057,  0.0004,\n",
      "        -0.0235,  0.0163,  0.0080,  0.0402], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00114797/1.0000000\n",
      "grad_weights: tensor([ 0.0359,  0.0039, -0.0125, -0.0683,  0.0004,  0.0001,  0.0371,  0.0184,\n",
      "         0.0229,  0.0301,  0.0001, -0.0195,  0.0032,  0.0143,  0.0049,  0.0003,\n",
      "        -0.0198,  0.0144,  0.0068,  0.0366], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00113556/1.0000000\n",
      "grad_weights: tensor([ 3.1794e-02,  3.1488e-03, -1.0010e-02, -5.5630e-02,  2.9844e-04,\n",
      "         9.7964e-05,  3.0130e-02,  1.5949e-02,  1.9518e-02,  2.5664e-02,\n",
      "         9.3137e-05, -1.4193e-02,  2.8077e-03,  1.2463e-02,  4.1968e-03,\n",
      "         2.6240e-04, -1.6356e-02,  1.2351e-02,  5.5106e-03,  3.2676e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00112586/1.0000000\n",
      "grad_weights: tensor([ 2.7193e-02,  2.3381e-03, -7.7687e-03, -4.3559e-02,  1.9175e-04,\n",
      "         7.3124e-05,  2.2895e-02,  1.3149e-02,  1.5968e-02,  2.0782e-02,\n",
      "         7.0054e-05, -9.9310e-03,  2.3489e-03,  1.0256e-02,  3.3325e-03,\n",
      "         1.8305e-04, -1.3253e-02,  1.0085e-02,  4.2193e-03,  2.8370e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00111874/1.0000000\n",
      "grad_weights: tensor([ 2.2238e-02,  1.4914e-03, -5.7591e-03, -3.3050e-02,  8.1983e-05,\n",
      "         4.4567e-05,  1.5567e-02,  1.0708e-02,  1.2434e-02,  1.5594e-02,\n",
      "         4.5514e-05, -6.5392e-03,  1.8338e-03,  7.7530e-03,  2.4525e-03,\n",
      "         1.0058e-04, -1.0142e-02,  7.6557e-03,  2.9445e-03,  2.3815e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00111399/1.0000000\n",
      "grad_weights: tensor([ 1.6854e-02,  6.0474e-04, -3.9485e-03, -2.3480e-02, -3.4758e-05,\n",
      "         1.1771e-05,  8.0541e-03,  7.4934e-03,  8.8204e-03,  1.0031e-02,\n",
      "         1.9219e-05, -3.8197e-03,  1.2356e-03,  4.8978e-03,  1.7194e-03,\n",
      "         2.7855e-05, -7.1696e-03,  5.0599e-03,  1.6560e-03,  1.8977e-02],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(-0.5080, device='cuda:1'), 0.6, 0.5)\n",
      "=====> Optimized weights: tensor([-4.3488, -4.1896,  4.0919,  4.1329, -4.0953, -4.2333, -4.1895, -4.3220,\n",
      "        -4.2649, -4.2916, -4.2098,  3.8616, -4.3605, -4.3439, -4.2508, -4.1273,\n",
      "         4.1728, -4.2893, -4.1872, -4.3521], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941]\n",
      "=====> init acc: (tensor(0.9000, device='cuda:1'), 0.9, 0.95)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 240 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0024, -0.0151,  0.0016,  0.0053,  0.0216,  0.0024,  0.0297,  0.0024,\n",
      "         0.0010,  0.0003,  0.0266,  0.0233,  0.0039,  0.0023,  0.1198,  0.0051,\n",
      "         0.0027, -0.0297,  0.0013,  0.0312], device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.00118221/1.0000000\n",
      "grad_weights: tensor([ 0.0019, -0.0084,  0.0012,  0.0037,  0.0163,  0.0021,  0.0242,  0.0019,\n",
      "         0.0007,  0.0002,  0.0208,  0.0190,  0.0029,  0.0016,  0.0976,  0.0042,\n",
      "         0.0023, -0.0198,  0.0008,  0.0274], device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.00113562/1.0000000\n",
      "grad_weights: tensor([ 1.2012e-03, -4.1104e-03,  6.4235e-04,  1.9935e-03,  1.1157e-02,\n",
      "         1.4456e-03,  1.6254e-02,  1.3496e-03,  3.0450e-04,  7.7528e-05,\n",
      "         1.4351e-02,  1.3663e-02,  1.7516e-03,  7.4271e-04,  6.7337e-02,\n",
      "         2.6559e-03,  1.4297e-03, -1.1149e-02,  3.9805e-04,  1.9895e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.00111289/1.0000000\n",
      "grad_weights: tensor([ 3.5064e-04, -1.4655e-03,  6.7409e-05,  2.8834e-05,  5.9913e-03,\n",
      "         3.9802e-04,  5.1190e-03,  5.6317e-04, -1.4863e-04, -2.2500e-05,\n",
      "         7.1301e-03,  7.0441e-03,  4.9975e-04, -2.8339e-04,  2.9557e-02,\n",
      "         1.5457e-04, -1.7040e-04, -4.1789e-03, -3.7722e-05,  8.3425e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.00111106/1.0000000\n",
      "grad_weights: tensor([-0.0007,  0.0002, -0.0005, -0.0020,  0.0010, -0.0011, -0.0089, -0.0004,\n",
      "        -0.0007, -0.0001, -0.0007, -0.0008, -0.0009, -0.0015, -0.0129, -0.0034,\n",
      "        -0.0026,  0.0014, -0.0005, -0.0072], device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.00112203/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6920, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-11.2231,  10.8227, -10.7254, -10.5564, -11.8070, -11.1750, -11.3199,\n",
      "        -11.5880,  -9.6344,  -9.9361, -11.7564, -11.8516, -11.1469,  -9.8116,\n",
      "        -11.6711, -10.5915, -10.1020,  11.2154, -10.3095, -11.6513],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403]\n",
      "=====> init acc: (tensor(0.8000, device='cuda:1'), 0.9, 0.9)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0004, -0.0239,  0.0026,  0.0017,  0.0002,  0.0002,  0.0531,  0.0149,\n",
      "        -0.0271,  0.0015, -0.0750,  0.0034,  0.0082,  0.0032,  0.0205,  0.0014,\n",
      "         0.0097,  0.0004,  0.0009,  0.0100], device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00118448/1.0000000\n",
      "grad_weights: tensor([ 0.0004, -0.0183,  0.0018,  0.0013,  0.0002,  0.0001,  0.0449,  0.0121,\n",
      "        -0.0198,  0.0012, -0.0505,  0.0029,  0.0065,  0.0029,  0.0163,  0.0011,\n",
      "         0.0082,  0.0003,  0.0008,  0.0084], device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00113555/1.0000000\n",
      "grad_weights: tensor([ 0.0003, -0.0131,  0.0010,  0.0008,  0.0001,  0.0001,  0.0342,  0.0088,\n",
      "        -0.0134,  0.0008, -0.0309,  0.0022,  0.0047,  0.0024,  0.0120,  0.0006,\n",
      "         0.0060,  0.0002,  0.0006,  0.0062], device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00110601/1.0000000\n",
      "grad_weights: tensor([ 1.6220e-04, -8.7722e-03,  1.6425e-04,  9.7272e-05,  3.5212e-05,\n",
      "         5.0294e-05,  2.0965e-02,  5.0900e-03, -8.2461e-03,  2.3792e-04,\n",
      "        -1.5706e-02,  1.3926e-03,  2.8384e-03,  1.4940e-03,  7.6212e-03,\n",
      "         1.0227e-04,  2.6417e-03,  2.6713e-05,  3.1852e-04,  3.4191e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00109374/1.0000000\n",
      "grad_weights: tensor([ 3.2626e-05, -5.0964e-03, -7.3672e-04, -6.8032e-04, -1.4223e-04,\n",
      "        -4.1189e-05,  5.2376e-03,  1.1891e-03, -3.5998e-03, -4.5466e-04,\n",
      "        -4.0431e-03,  3.9896e-04,  9.2588e-04,  1.4873e-04,  3.0655e-03,\n",
      "        -4.9298e-04, -1.8887e-03, -1.2976e-04, -1.5265e-04, -1.1961e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00109501/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4873, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-14.3955,  14.4741, -12.9455, -12.8911, -13.0960, -13.9260, -14.5184,\n",
      "        -14.3700,  14.2167, -13.4407,  13.7775, -14.5638, -14.3765, -14.6172,\n",
      "        -14.4745, -12.9958, -13.9657, -12.9173, -14.1710, -14.3048],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 9.4925e-03,  1.3763e-02, -3.6280e-02,  9.0233e-04,  5.5905e-03,\n",
      "         4.3722e-03,  6.7073e-04,  5.0564e-05,  4.3164e-02,  2.5156e-03,\n",
      "         1.9464e-03,  7.8937e-02,  1.1663e-03,  6.6590e-03,  1.3892e-02,\n",
      "         2.3747e-03,  4.0242e-03,  2.1794e-03,  2.7670e-04,  1.5929e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00120022/1.0000000\n",
      "grad_weights: tensor([ 1.0027e-02,  1.1931e-02, -2.7518e-02,  7.9347e-04,  4.9726e-03,\n",
      "         3.6344e-03,  5.3770e-04,  4.1314e-05,  3.6247e-02,  2.0103e-03,\n",
      "         1.6061e-03,  6.9371e-02,  9.4139e-04,  5.5068e-03,  1.2264e-02,\n",
      "         1.9476e-03,  3.2239e-03,  1.7028e-03,  1.8672e-04,  1.4136e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00115994/1.0000000\n",
      "grad_weights: tensor([ 9.9255e-03,  9.5199e-03, -2.0037e-02,  6.7667e-04,  3.8986e-03,\n",
      "         2.7212e-03,  3.9744e-04,  3.1125e-05,  2.8543e-02,  1.4516e-03,\n",
      "         1.2321e-03,  5.6640e-02,  6.3972e-04,  4.2336e-03,  1.0055e-02,\n",
      "         1.4482e-03,  2.3868e-03,  1.2020e-03,  9.1228e-05,  1.1837e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00113268/1.0000000\n",
      "grad_weights: tensor([ 8.6519e-03,  6.5977e-03, -1.3328e-02,  4.7793e-04,  2.4563e-03,\n",
      "         1.6437e-03,  2.4883e-04,  1.8414e-05,  1.9859e-02,  8.2344e-04,\n",
      "         8.1311e-04,  4.0914e-02,  2.3414e-04,  2.8362e-03,  7.1616e-03,\n",
      "         8.5831e-04,  1.4801e-03,  6.5621e-04, -1.5905e-05,  8.9167e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00111792/1.0000000\n",
      "grad_weights: tensor([ 5.5743e-03,  2.6672e-03, -7.4226e-03,  2.1333e-04,  5.6908e-04,\n",
      "         3.8949e-04,  9.0060e-05,  2.9151e-06,  1.0265e-02,  1.2843e-04,\n",
      "         3.4733e-04,  2.2116e-02, -2.9913e-04,  1.3400e-03,  3.4547e-03,\n",
      "         2.1593e-04,  5.0186e-04,  8.1774e-05, -1.3415e-04,  5.2974e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00111436/1.0000000\n",
      "grad_weights: tensor([ 5.1812e-05, -1.9687e-03, -2.3813e-03, -1.0890e-04, -1.7343e-03,\n",
      "        -1.0047e-03, -7.3304e-05, -1.4464e-05,  1.1021e-04, -6.1472e-04,\n",
      "        -1.4395e-04,  1.0712e-03, -9.4998e-04, -2.4975e-04, -1.0091e-03,\n",
      "        -5.5194e-04, -5.1949e-04, -5.1343e-04, -2.5851e-04,  1.0266e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00111911/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5808, device='cuda:1'), 0.9, 1.0)\n",
      "=====> Optimized weights: tensor([-14.3754, -13.5470,  13.4662, -13.6935, -13.2123, -13.1128, -13.2375,\n",
      "        -12.6649, -13.6878, -12.8999, -13.4585, -13.8447, -11.4561, -13.5415,\n",
      "        -13.7370, -13.0730, -13.2207, -12.8024,  -9.5980, -13.9906],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134]\n",
      "=====> init acc: (tensor(0.8000, device='cuda:1'), 0.9, 0.9)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 300 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0024,  0.0077,  0.0005,  0.0041,  0.0007,  0.0118,  0.0015,  0.0051,\n",
      "         0.0025,  0.0348, -0.0709,  0.0038,  0.0024,  0.0264,  0.0003,  0.0061,\n",
      "         0.0049,  0.0113,  0.0008,  0.0100], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.00120825/1.0000000\n",
      "grad_weights: tensor([ 0.0022,  0.0067,  0.0004,  0.0034,  0.0006,  0.0102,  0.0013,  0.0045,\n",
      "         0.0023,  0.0321, -0.0547,  0.0035,  0.0022,  0.0232,  0.0003,  0.0049,\n",
      "         0.0047,  0.0100,  0.0007,  0.0088], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.00117207/1.0000000\n",
      "grad_weights: tensor([ 0.0020,  0.0056,  0.0004,  0.0027,  0.0004,  0.0082,  0.0011,  0.0039,\n",
      "         0.0019,  0.0282, -0.0405,  0.0031,  0.0020,  0.0195,  0.0002,  0.0036,\n",
      "         0.0042,  0.0085,  0.0005,  0.0074], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.00114534/1.0000000\n",
      "grad_weights: tensor([ 0.0016,  0.0045,  0.0003,  0.0020,  0.0002,  0.0057,  0.0008,  0.0031,\n",
      "         0.0015,  0.0235, -0.0283,  0.0026,  0.0015,  0.0155,  0.0001,  0.0023,\n",
      "         0.0033,  0.0066,  0.0004,  0.0059], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.00112759/1.0000000\n",
      "grad_weights: tensor([ 1.2098e-03,  3.2552e-03,  1.6798e-04,  1.1739e-03, -4.1007e-05,\n",
      "         2.6848e-03,  3.2861e-04,  2.2681e-03,  1.0172e-03,  1.7475e-02,\n",
      "        -1.8019e-02,  1.8773e-03,  8.5391e-04,  1.0927e-02,  5.5450e-05,\n",
      "         8.5570e-04,  2.0148e-03,  4.5864e-03,  1.6308e-04,  4.1289e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.00111817/1.0000000\n",
      "grad_weights: tensor([ 6.2234e-04,  1.9853e-03,  1.8384e-05,  3.4641e-04, -2.7622e-04,\n",
      "        -8.7236e-04, -2.6299e-04,  1.2990e-03,  4.5311e-04,  1.0267e-02,\n",
      "        -9.3835e-03,  1.0606e-03, -6.4202e-05,  5.9561e-03, -2.7779e-05,\n",
      "        -6.0074e-04,  2.2432e-04,  2.1011e-03, -1.0083e-04,  2.1571e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.00111589/1.0000000\n",
      "grad_weights: tensor([-8.0518e-05,  7.0070e-04, -1.6077e-04, -4.7254e-04, -5.2196e-04,\n",
      "        -4.6996e-03, -9.8478e-04,  2.5430e-04, -1.7148e-04,  2.1112e-03,\n",
      "        -2.3984e-03,  9.3414e-05, -1.2366e-03,  7.4774e-04, -1.1364e-04,\n",
      "        -2.0478e-03, -2.0546e-03, -6.8055e-04, -3.9145e-04,  2.9778e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.00111865/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6891, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-15.9364, -15.8281, -15.1205, -15.1156, -12.3413, -14.5645, -14.2405,\n",
      "        -15.8632, -15.6102, -16.0175,  15.0645, -15.9660, -14.9836, -15.7497,\n",
      "        -14.2226, -14.1194, -15.2703, -15.6365, -14.3565, -15.7261],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.8, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0226,  0.0172,  0.0002,  0.0017,  0.0043,  0.0062,  0.0124,  0.0014,\n",
      "        -0.0421,  0.0003, -0.1086,  0.0004,  0.0020,  0.0002,  0.0147, -0.0678,\n",
      "         0.0061, -0.0431,  0.0055,  0.0643], device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.00119377/1.0000000\n",
      "grad_weights: tensor([ 0.0173,  0.0159,  0.0001,  0.0013,  0.0033,  0.0047,  0.0104,  0.0011,\n",
      "        -0.0325,  0.0002, -0.0743,  0.0003,  0.0016,  0.0001,  0.0135, -0.0477,\n",
      "         0.0045, -0.0293,  0.0046,  0.0524], device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.00115018/1.0000000\n",
      "grad_weights: tensor([ 1.1592e-02,  1.3270e-02,  5.7893e-05,  9.1872e-04,  2.2452e-03,\n",
      "         3.0996e-03,  7.8574e-03,  7.5999e-04, -2.3778e-02,  1.4859e-04,\n",
      "        -4.7904e-02,  2.2907e-04,  1.1214e-03,  9.3480e-05,  1.0833e-02,\n",
      "        -3.1190e-02,  2.8159e-03, -1.8995e-02,  3.4568e-03,  3.9491e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.00112236/1.0000000\n",
      "grad_weights: tensor([ 5.4873e-03,  8.5088e-03, -8.6540e-06,  5.5155e-04,  1.2396e-03,\n",
      "         1.4448e-03,  4.6885e-03,  4.0882e-04, -1.5839e-02,  6.6736e-05,\n",
      "        -2.7312e-02,  1.2133e-04,  5.2701e-04,  3.8172e-05,  6.1176e-03,\n",
      "        -1.7843e-02,  1.1919e-03, -1.1394e-02,  1.9404e-03,  2.5187e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.00110879/1.0000000\n",
      "grad_weights: tensor([-9.7603e-04,  1.4224e-03, -8.6106e-05,  1.8601e-04,  2.6865e-04,\n",
      "        -2.6198e-04,  1.1849e-03,  4.8306e-05, -8.8682e-03, -3.4620e-05,\n",
      "        -1.2063e-02, -1.6492e-05, -1.7858e-04, -2.9273e-05, -9.0673e-04,\n",
      "        -7.2742e-03, -4.5937e-04, -5.9480e-03,  8.5050e-05,  1.0132e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.00110680/1.0000000\n",
      "grad_weights: tensor([-0.0074, -0.0079, -0.0002, -0.0002, -0.0006, -0.0020, -0.0031, -0.0003,\n",
      "        -0.0028, -0.0002, -0.0019, -0.0002, -0.0010, -0.0001, -0.0101,  0.0009,\n",
      "        -0.0020, -0.0023, -0.0020, -0.0050], device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.00111196/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3815, device='cuda:1'), 0.8, 0.5)\n",
      "=====> Optimized weights: tensor([-8.1229, -8.6328, -6.2389, -8.6084, -8.4327, -8.1052, -8.6036, -8.3714,\n",
      "         8.8565, -7.8871,  8.4544, -8.2050, -8.0486, -7.7222, -8.2563,  8.4732,\n",
      "        -7.9383,  8.5218, -8.4138, -8.7743], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 1.0, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 5.2839e-03,  4.6718e-04,  1.5470e-02,  1.5416e-04,  1.6324e-02,\n",
      "         6.7284e-05,  3.1179e-02,  6.0358e-04,  2.5179e-02, -4.0893e-03,\n",
      "         1.7829e-02,  1.3229e-03,  1.6974e-02, -9.8738e-03,  7.6406e-03,\n",
      "         1.3512e-02,  1.6135e-02, -1.1022e-01,  1.7333e-02,  3.2595e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00122451/1.0000000\n",
      "grad_weights: tensor([ 4.7083e-03,  4.3757e-04,  1.4816e-02,  1.3987e-04,  1.4777e-02,\n",
      "         6.1370e-05,  2.8724e-02,  5.1848e-04,  2.2317e-02, -3.6710e-03,\n",
      "         1.6512e-02,  1.2018e-03,  1.4901e-02, -8.3559e-03,  7.2501e-03,\n",
      "         1.2375e-02,  1.4769e-02, -9.5406e-02,  1.6059e-02,  3.2158e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00119866/1.0000000\n",
      "grad_weights: tensor([ 4.1135e-03,  4.0145e-04,  1.3874e-02,  1.2481e-04,  1.3222e-02,\n",
      "         5.4776e-05,  2.5976e-02,  4.3070e-04,  1.9388e-02, -3.2708e-03,\n",
      "         1.5156e-02,  1.0761e-03,  1.2712e-02, -6.9897e-03,  6.7151e-03,\n",
      "         1.1165e-02,  1.3377e-02, -8.1450e-02,  1.4637e-02,  3.1273e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00117650/1.0000000\n",
      "grad_weights: tensor([ 3.4975e-03,  3.5690e-04,  1.2673e-02,  1.0914e-04,  1.1698e-02,\n",
      "         4.7674e-05,  2.3060e-02,  3.4176e-04,  1.6439e-02, -2.9032e-03,\n",
      "         1.3723e-02,  9.4400e-04,  1.0501e-02, -5.7636e-03,  6.0414e-03,\n",
      "         9.8763e-03,  1.1967e-02, -6.8543e-02,  1.3115e-02,  2.9723e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00115801/1.0000000\n",
      "grad_weights: tensor([ 2.8477e-03,  3.0298e-04,  1.1109e-02,  9.2634e-05,  1.0127e-02,\n",
      "         3.9727e-05,  1.9988e-02,  2.4679e-04,  1.3443e-02, -2.5491e-03,\n",
      "         1.2155e-02,  8.0877e-04,  8.0995e-03, -4.6395e-03,  5.1846e-03,\n",
      "         8.5468e-03,  1.0469e-02, -5.6650e-02,  1.1481e-02,  2.7437e-04],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 340 | 993 ####, loss/acc = 0.00114308/1.0000000\n",
      "grad_weights: tensor([ 2.2080e-03,  2.4110e-04,  9.2752e-03,  7.5722e-05,  8.5979e-03,\n",
      "         3.1356e-05,  1.6714e-02,  1.5181e-04,  1.0474e-02, -2.2269e-03,\n",
      "         1.0568e-02,  6.6988e-04,  5.8007e-03, -3.6593e-03,  4.1892e-03,\n",
      "         7.1500e-03,  9.0287e-03, -4.5893e-02,  9.7571e-03,  2.4688e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00113155/1.0000000\n",
      "grad_weights: tensor([ 1.5499e-03,  1.6979e-04,  7.0417e-03,  5.8000e-05,  7.0759e-03,\n",
      "         2.2268e-05,  1.3258e-02,  5.2791e-05,  7.5043e-03, -1.9267e-03,\n",
      "         8.8991e-03,  5.2659e-04,  3.4356e-03, -2.7848e-03,  3.0003e-03,\n",
      "         5.6943e-03,  7.5718e-03, -3.6133e-02,  7.9253e-03,  2.0823e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00112322/1.0000000\n",
      "grad_weights: tensor([ 8.7763e-04,  9.0592e-05,  4.3913e-03,  3.9740e-05,  5.5580e-03,\n",
      "         1.2530e-05,  9.5851e-03, -4.8020e-05,  4.5237e-03, -1.6463e-03,\n",
      "         7.1588e-03,  3.7949e-04,  1.0345e-03, -2.0024e-03,  1.6197e-03,\n",
      "         4.1761e-03,  6.1026e-03, -2.7274e-02,  5.9749e-03,  1.5926e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00111782/1.0000000\n",
      "grad_weights: tensor([ 2.1244e-04,  3.7878e-07,  1.4098e-03,  2.1732e-05,  4.0828e-03,\n",
      "         2.3961e-06,  5.8436e-03, -1.4947e-04,  1.6036e-03, -1.3915e-03,\n",
      "         5.3915e-03,  2.3257e-04, -1.3473e-03, -1.3182e-03,  4.4581e-05,\n",
      "         2.6358e-03,  4.6729e-03, -1.9407e-02,  3.9674e-03,  1.0105e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00111495/1.0000000\n",
      "grad_weights: tensor([-4.4201e-04, -9.6687e-05, -1.8593e-03,  3.4688e-06,  2.6517e-03,\n",
      "        -8.0844e-06,  2.0824e-03, -2.4885e-04, -1.2231e-03, -1.1602e-03,\n",
      "         3.6432e-03,  8.6553e-05, -3.6775e-03, -7.2229e-04, -1.6779e-03,\n",
      "         1.0923e-03,  3.2752e-03, -1.2520e-02,  1.9347e-03,  3.3144e-05],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(-0.5944, device='cuda:1'), 0.9, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-8.9623, -9.0690, -9.3131, -9.1480, -9.3961, -8.8852, -9.3425, -8.0634,\n",
      "        -8.9909,  9.5034, -9.5282, -9.2787, -8.6167,  8.9734, -9.1447, -9.3411,\n",
      "        -9.4772,  9.1283, -9.4209, -9.6356], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.7, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0032,  0.0031,  0.0591,  0.0230,  0.0054,  0.0057, -0.0443,  0.0125,\n",
      "        -0.0011,  0.0048,  0.0038,  0.0095,  0.0193,  0.0050,  0.0028,  0.0008,\n",
      "         0.0002, -0.0166, -0.0341, -0.0583], device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.00120246/1.0000000\n",
      "grad_weights: tensor([ 0.0026,  0.0024,  0.0524,  0.0189,  0.0047,  0.0045, -0.0324,  0.0114,\n",
      "        -0.0009,  0.0041,  0.0032,  0.0076,  0.0169,  0.0045,  0.0021,  0.0008,\n",
      "         0.0001, -0.0106, -0.0271, -0.0412], device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.00116282/1.0000000\n",
      "grad_weights: tensor([ 1.9968e-03,  1.7328e-03,  4.4412e-02,  1.4725e-02,  3.8924e-03,\n",
      "         3.2915e-03, -2.2536e-02,  9.6756e-03, -7.0213e-04,  3.1660e-03,\n",
      "         2.5514e-03,  5.6470e-03,  1.4090e-02,  3.8207e-03,  1.4511e-03,\n",
      "         7.2758e-04,  9.6962e-05, -6.5395e-03, -2.0828e-02, -2.7461e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.00113468/1.0000000\n",
      "grad_weights: tensor([ 1.3967e-03,  1.0038e-03,  3.5264e-02,  1.0232e-02,  2.9973e-03,\n",
      "         2.0374e-03, -1.4291e-02,  7.1468e-03, -5.1936e-04,  2.0865e-03,\n",
      "         1.7582e-03,  3.6466e-03,  1.0923e-02,  2.8168e-03,  8.0552e-04,\n",
      "         5.7532e-04,  4.2777e-05, -3.8141e-03, -1.5083e-02, -1.6808e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.00111728/1.0000000\n",
      "grad_weights: tensor([ 7.1578e-04,  2.7124e-04,  2.5155e-02,  5.5543e-03,  2.1493e-03,\n",
      "         7.5930e-04, -7.6625e-03,  3.7211e-03, -3.5611e-04,  8.3727e-04,\n",
      "         8.4534e-04,  1.6984e-03,  7.4289e-03,  1.4851e-03,  1.1856e-04,\n",
      "         3.6319e-04, -1.3289e-05, -2.0168e-03, -1.0036e-02, -8.6316e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.00110933/1.0000000\n",
      "grad_weights: tensor([ 8.5733e-06, -4.7325e-04,  1.4251e-02,  7.8514e-04,  1.1279e-03,\n",
      "        -5.1825e-04, -2.3393e-03, -5.5683e-04, -2.1198e-04, -5.6806e-04,\n",
      "        -1.8086e-04, -3.3483e-04,  3.6755e-03, -1.9144e-04, -5.5974e-04,\n",
      "        -2.7351e-05, -7.1193e-05, -8.5695e-04, -5.6378e-03, -2.4436e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.00110898/1.0000000\n",
      "grad_weights: tensor([-7.0494e-04, -1.1983e-03,  3.0279e-03, -3.9525e-03,  7.8599e-05,\n",
      "        -1.7707e-03,  1.8618e-03, -5.6595e-03, -8.7292e-05, -2.0944e-03,\n",
      "        -1.2767e-03, -2.3240e-03, -2.2647e-04, -2.1634e-03, -1.1741e-03,\n",
      "        -5.5578e-04, -1.2883e-04, -1.2335e-04, -1.7500e-03,  2.1457e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.00111354/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3834, device='cuda:1'), 0.8, 0.6)\n",
      "=====> Optimized weights: tensor([-11.1191, -10.3528, -11.9380, -11.2229, -11.8196, -10.6465,  10.9512,\n",
      "        -11.2108,  11.6204, -10.7623, -11.0284, -10.8894, -11.7951, -11.2183,\n",
      "        -10.0768, -11.3408,  -9.2320,  10.5374,  11.5513,  10.7946],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.8, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([0.0004, 0.0002, 0.1250, 0.0042, 0.0055, 0.0019, 0.0005, 0.0130, 0.0003,\n",
      "        0.0462, 0.0252, 0.0246, 0.0238, 0.0485, 0.0013, 0.0136, 0.0004, 0.0008,\n",
      "        0.0135, 0.0003], device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.00118487/1.0000000\n",
      "grad_weights: tensor([0.0004, 0.0002, 0.0924, 0.0042, 0.0042, 0.0011, 0.0004, 0.0098, 0.0002,\n",
      "        0.0371, 0.0269, 0.0201, 0.0202, 0.0406, 0.0007, 0.0106, 0.0002, 0.0006,\n",
      "        0.0102, 0.0002], device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.00114222/1.0000000\n",
      "grad_weights: tensor([2.3234e-04, 9.9364e-05, 5.5919e-02, 3.3257e-03, 2.0473e-03, 3.4138e-04,\n",
      "        3.0966e-04, 6.2078e-03, 1.1012e-04, 2.3067e-02, 2.4297e-02, 1.3370e-02,\n",
      "        1.5091e-02, 2.7291e-02, 1.6802e-04, 6.2885e-03, 1.0494e-04, 3.4650e-04,\n",
      "        5.4248e-03, 8.9874e-05], device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.00112496/1.0000000\n",
      "grad_weights: tensor([ 3.9125e-05, -2.9874e-05,  1.5456e-02,  1.0520e-03, -1.2062e-03,\n",
      "        -5.6520e-04,  1.1271e-04,  2.2867e-03,  3.1885e-06,  3.3424e-03,\n",
      "         1.2546e-02,  3.7438e-03,  7.9822e-03,  7.7108e-03, -4.0895e-04,\n",
      "         7.7307e-04, -5.9353e-05,  6.3984e-05, -1.1213e-03, -4.4443e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.00112953/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3781, device='cuda:1'), 0.9, 0.7)\n",
      "=====> Optimized weights: tensor([-8.8601, -8.5827, -8.8102, -9.1612, -8.3590, -7.8179, -9.0340, -8.8890,\n",
      "        -8.6571, -8.8361, -9.3308, -8.9457, -9.1427, -8.9703, -7.6407, -8.7761,\n",
      "        -8.2245, -8.7629, -8.5540, -8.1949], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591]\n",
      "reset tmp model\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.9, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([-0.0165,  0.0665,  0.0027,  0.0186,  0.0009,  0.0218,  0.0034,  0.0001,\n",
      "         0.0007,  0.0031,  0.0012,  0.0075,  0.0773,  0.0011,  0.0010,  0.0005,\n",
      "        -0.0092,  0.0097,  0.0011,  0.0013], device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.00117978/1.0000000\n",
      "grad_weights: tensor([-1.1008e-02,  5.2692e-02,  1.7090e-03,  1.4537e-02,  5.9036e-04,\n",
      "         1.6685e-02,  2.9666e-03,  7.3352e-05,  4.8979e-04,  2.4018e-03,\n",
      "         7.8643e-04,  4.7749e-03,  7.1966e-02,  1.2451e-03,  5.6631e-04,\n",
      "         4.0056e-04, -5.3487e-03,  7.3149e-03,  7.4160e-04,  1.0063e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.00113641/1.0000000\n",
      "grad_weights: tensor([-5.9972e-03,  3.0385e-02,  6.5194e-04,  8.8621e-03,  2.5393e-04,\n",
      "         9.2861e-03,  2.0258e-03,  3.8955e-05,  2.2440e-04,  1.4560e-03,\n",
      "         3.1946e-04,  1.4914e-03,  5.1803e-02,  9.7949e-04,  1.7316e-04,\n",
      "         2.2420e-04, -2.5575e-03,  4.5258e-03,  2.6499e-04,  5.0925e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.00112238/1.0000000\n",
      "grad_weights: tensor([-1.3092e-03, -1.6946e-03, -5.1430e-04,  9.8286e-04, -1.8041e-04,\n",
      "        -1.1622e-03,  2.3925e-04, -1.8361e-06, -6.2717e-05,  8.4866e-05,\n",
      "        -1.8153e-04, -2.5500e-03,  1.3246e-02, -6.2237e-04, -2.2446e-04,\n",
      "        -4.2919e-05, -4.7782e-04,  1.2655e-03, -3.8506e-04, -2.3873e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.00113164/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5952, device='cuda:1'), 0.8, 0.5)\n",
      "=====> Optimized weights: tensor([ 13.4578, -13.5556, -12.6241, -13.7024, -12.7902, -13.4421, -13.9170,\n",
      "        -13.2337, -13.0196, -13.6589, -12.7584, -12.2145, -14.1209, -13.2109,\n",
      "        -12.2718, -13.3828,  13.1112, -13.7760, -12.3576, -13.1235],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0293,  0.0395, -0.2048,  0.0007,  0.0208,  0.0282, -0.0860,  0.0007,\n",
      "         0.0108,  0.0003,  0.0078,  0.0082, -0.0654, -0.0103,  0.0022, -0.0308,\n",
      "        -0.0525,  0.0051,  0.0148,  0.0126], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00120843/1.0000000\n",
      "grad_weights: tensor([ 0.0269,  0.0355, -0.1573,  0.0006,  0.0188,  0.0263, -0.0684,  0.0006,\n",
      "         0.0090,  0.0002,  0.0065,  0.0071, -0.0537, -0.0070,  0.0021, -0.0245,\n",
      "        -0.0393,  0.0043,  0.0130,  0.0111], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00117177/1.0000000\n",
      "grad_weights: tensor([ 0.0245,  0.0307, -0.1157,  0.0005,  0.0163,  0.0236, -0.0529,  0.0004,\n",
      "         0.0072,  0.0002,  0.0052,  0.0059, -0.0426, -0.0046,  0.0018, -0.0186,\n",
      "        -0.0282,  0.0035,  0.0109,  0.0095], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00114387/1.0000000\n",
      "grad_weights: tensor([ 0.0207,  0.0250, -0.0801,  0.0004,  0.0130,  0.0203, -0.0396,  0.0003,\n",
      "         0.0053,  0.0001,  0.0038,  0.0047, -0.0327, -0.0030,  0.0015, -0.0133,\n",
      "        -0.0189,  0.0026,  0.0085,  0.0078], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00112418/1.0000000\n",
      "grad_weights: tensor([ 1.6184e-02,  1.9150e-02, -5.1340e-02,  2.0407e-04,  9.1306e-03,\n",
      "         1.6325e-02, -2.8169e-02,  1.2713e-04,  3.4541e-03,  6.2911e-05,\n",
      "         2.5321e-03,  3.4106e-03, -2.3603e-02, -1.8400e-03,  1.1708e-03,\n",
      "        -8.4002e-03, -1.1347e-02,  1.7102e-03,  5.9796e-03,  5.8968e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00111201/1.0000000\n",
      "grad_weights: tensor([ 1.1147e-02,  1.2065e-02, -2.8057e-02,  2.4707e-05,  4.8289e-03,\n",
      "         1.1504e-02, -1.8324e-02, -3.7687e-05,  1.5376e-03, -2.9073e-06,\n",
      "         1.0991e-03,  2.1083e-03, -1.5193e-02, -1.0800e-03,  6.9279e-04,\n",
      "        -3.9897e-03, -5.1531e-03,  7.1703e-04,  3.1480e-03,  3.8617e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00110653/1.0000000\n",
      "grad_weights: tensor([ 5.1537e-03,  4.1703e-03, -9.5340e-03, -1.5661e-04, -5.9603e-04,\n",
      "         5.8777e-03, -9.9145e-03, -2.1050e-04, -3.9075e-04, -7.2658e-05,\n",
      "        -3.4927e-04,  8.6341e-04, -7.4581e-03, -5.1884e-04,  9.9133e-05,\n",
      "         8.3955e-05, -1.4355e-04, -3.1861e-04,  4.3038e-05,  1.6854e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00110655/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5005, device='cuda:1'), 0.8, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-5.2896, -5.2155,  4.9064, -4.8746, -5.1446, -5.3113,  5.0444, -4.6892,\n",
      "        -5.0003, -4.7476, -5.0017, -5.1539,  5.0902,  4.7232, -5.2340,  4.9344,\n",
      "         4.8255, -5.0117, -5.1144, -5.2108], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 1.2809e-03,  2.2820e-03, -7.4097e-02,  1.9005e-02,  2.8669e-03,\n",
      "         3.1065e-02,  3.0749e-03,  1.7762e-03,  1.0143e-03,  3.5752e-03,\n",
      "         2.5807e-02,  6.0572e-03,  1.8632e-02,  6.4613e-02,  3.9799e-03,\n",
      "         3.3226e-02,  9.7239e-05,  5.3678e-02,  1.6976e-02,  4.3191e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.00119598/1.0000000\n",
      "grad_weights: tensor([ 1.0154e-03,  2.1236e-03, -4.5691e-02,  1.6058e-02,  2.2873e-03,\n",
      "         2.8888e-02,  2.4705e-03,  1.5652e-03,  9.5871e-04,  2.9277e-03,\n",
      "         2.1937e-02,  4.6414e-03,  1.7587e-02,  5.6348e-02,  3.3308e-03,\n",
      "         2.9481e-02,  7.1384e-05,  4.4832e-02,  1.4809e-02,  3.4029e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.00115586/1.0000000\n",
      "grad_weights: tensor([ 6.9657e-04,  1.7453e-03, -2.5633e-02,  1.2214e-02,  1.5628e-03,\n",
      "         2.4070e-02,  1.7752e-03,  1.1642e-03,  7.9242e-04,  2.1523e-03,\n",
      "         1.6942e-02,  3.2114e-03,  1.4762e-02,  4.3347e-02,  2.5659e-03,\n",
      "         2.2581e-02,  4.6156e-05,  3.2612e-02,  1.1284e-02,  2.3074e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.00113312/1.0000000\n",
      "grad_weights: tensor([ 3.1046e-04,  1.0019e-03, -1.2290e-02,  6.0549e-03,  6.6795e-04,\n",
      "         1.5864e-02,  9.2438e-04,  4.8996e-04,  4.6176e-04,  1.2113e-03,\n",
      "         1.0264e-02,  1.7745e-03,  9.7302e-03,  2.3972e-02,  1.4825e-03,\n",
      "         1.1901e-02,  1.6884e-05,  1.7882e-02,  5.9195e-03,  1.0360e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.00112660/1.0000000\n",
      "grad_weights: tensor([-1.4913e-04, -2.1083e-04, -3.2604e-03, -2.0839e-03, -3.9539e-04,\n",
      "         3.7377e-03, -6.5825e-05, -5.2908e-04, -1.0174e-04,  1.0983e-04,\n",
      "         1.9597e-03,  3.3456e-04,  1.9221e-03, -1.0488e-03,  1.5657e-04,\n",
      "        -2.9818e-03, -1.3652e-05,  1.1909e-03, -1.1540e-03, -4.1040e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.00113264/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4969, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-7.4150, -7.7114,  7.1896, -7.5632, -7.3969, -7.8746, -7.5601, -7.4032,\n",
      "        -7.7168, -7.6405, -7.7418, -7.5643, -7.8758, -7.6779, -7.6953, -7.6277,\n",
      "        -7.1667, -7.6380, -7.6265, -7.4265], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.9, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 460 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 7.9668e-05, -5.3960e-02,  3.3795e-04,  1.4187e-04,  2.2109e-03,\n",
      "         4.0104e-02, -1.4651e-02,  5.7054e-03,  7.9076e-03, -3.2167e-02,\n",
      "         8.8075e-03,  2.9553e-03,  1.3975e-02,  4.6705e-03,  1.5793e-02,\n",
      "         2.6066e-02,  1.2677e-02,  4.0510e-05,  3.6677e-02,  5.4011e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.00122110/1.0000000\n",
      "grad_weights: tensor([ 6.9722e-05, -4.3212e-02,  3.0552e-04,  1.3944e-04,  1.9807e-03,\n",
      "         4.2207e-02, -1.2428e-02,  5.2925e-03,  7.3270e-03, -2.6706e-02,\n",
      "         7.8926e-03,  2.6157e-03,  1.3248e-02,  4.3395e-03,  1.3847e-02,\n",
      "         2.3292e-02,  1.1798e-02,  3.5694e-05,  3.5059e-02,  5.1208e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.00119288/1.0000000\n",
      "grad_weights: tensor([ 5.9395e-05, -3.3938e-02,  2.6514e-04,  1.3227e-04,  1.7588e-03,\n",
      "         4.2787e-02, -1.0376e-02,  5.0497e-03,  6.5839e-03, -2.1843e-02,\n",
      "         6.8176e-03,  2.2735e-03,  1.2595e-02,  3.9139e-03,  1.1810e-02,\n",
      "         2.0324e-02,  1.0815e-02,  3.0689e-05,  3.2884e-02,  4.7013e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.00116940/1.0000000\n",
      "grad_weights: tensor([ 4.8455e-05, -2.5917e-02,  2.1643e-04,  1.1906e-04,  1.4736e-03,\n",
      "         4.2227e-02, -8.6448e-03,  4.3822e-03,  5.6914e-03, -1.7551e-02,\n",
      "         5.6063e-03,  1.9337e-03,  1.1483e-02,  3.3753e-03,  9.7057e-03,\n",
      "         1.7172e-02,  9.7046e-03,  2.5400e-05,  3.0108e-02,  4.1272e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.00115055/1.0000000\n",
      "grad_weights: tensor([ 3.7217e-05, -1.9156e-02,  1.6002e-04,  9.9324e-05,  1.1703e-03,\n",
      "         4.0430e-02, -6.8975e-03,  3.5915e-03,  4.6357e-03, -1.3817e-02,\n",
      "         4.2414e-03,  1.6181e-03,  1.0165e-02,  2.7314e-03,  7.5639e-03,\n",
      "         1.3882e-02,  8.4874e-03,  1.9880e-05,  2.6650e-02,  3.3978e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.00113615/1.0000000\n",
      "grad_weights: tensor([ 2.5408e-05, -1.3520e-02,  9.2998e-05,  7.0585e-05,  8.3892e-04,\n",
      "         3.7110e-02, -5.2941e-03,  2.6357e-03,  3.3942e-03, -1.0564e-02,\n",
      "         2.7131e-03,  1.2767e-03,  8.6635e-03,  1.9727e-03,  5.5044e-03,\n",
      "         1.0445e-02,  7.1528e-03,  1.4006e-05,  2.2476e-02,  2.4496e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.00112599/1.0000000\n",
      "grad_weights: tensor([ 1.3269e-05, -8.7251e-03,  1.5866e-05,  3.0641e-05,  4.7993e-04,\n",
      "         3.1865e-02, -3.8414e-03,  1.4847e-03,  1.9319e-03, -8.0005e-03,\n",
      "         1.0007e-03,  9.3482e-04,  6.9207e-03,  1.0759e-03,  3.2807e-03,\n",
      "         6.8577e-03,  5.6779e-03,  7.9341e-06,  1.7620e-02,  1.2708e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.00111977/1.0000000\n",
      "grad_weights: tensor([ 7.2495e-07, -4.7395e-03, -7.2422e-05, -2.2078e-05,  9.6966e-05,\n",
      "         2.4632e-02, -2.5076e-03,  1.6121e-04,  2.7736e-04, -5.4942e-03,\n",
      "        -8.8699e-04,  5.9570e-04,  5.1089e-03,  3.7907e-05,  9.8653e-04,\n",
      "         3.1299e-03,  4.0658e-03,  1.6533e-06,  1.2050e-02, -1.5441e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.00111703/1.0000000\n",
      "grad_weights: tensor([-1.2075e-05, -1.4634e-03, -1.6720e-04, -8.7529e-05, -3.0159e-04,\n",
      "         1.5620e-02, -1.3154e-03, -1.3291e-03, -1.5512e-03, -3.3501e-03,\n",
      "        -2.8959e-03,  2.6047e-04,  2.9858e-03, -1.1166e-03, -1.2735e-03,\n",
      "        -6.6460e-04,  2.3644e-03, -4.8262e-06,  5.9138e-03, -1.8075e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.00111708/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6920, device='cuda:1'), 0.8, 0.3333333333333333)\n",
      "=====> Optimized weights: tensor([ -9.8311,   9.8479,  -9.5376, -10.0135, -10.1758, -11.1835,  10.2825,\n",
      "        -10.3097, -10.2564,  10.1939,  -9.8149, -10.4571, -10.8621, -10.2084,\n",
      "        -10.1227, -10.3135, -10.7685,  -9.7876, -10.8236, -10.1891],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129]\n",
      "=====> init acc: (tensor(1., device='cuda:1'), 1.0, 1.0)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([7.9771e-04, 3.5970e-03, 9.6262e-03, 7.8775e-05, 1.2573e-04, 4.9975e-02,\n",
      "        6.8845e-04, 6.7934e-03, 4.4348e-04, 3.0157e-03, 2.3613e-02, 1.4310e-04,\n",
      "        3.4119e-04, 1.1328e-02, 9.6421e-02, 1.7704e-03, 2.9058e-04, 1.5981e-03,\n",
      "        1.7737e-03, 1.9374e-02], device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.00115596/1.0000000\n",
      "grad_weights: tensor([5.5189e-04, 1.9905e-03, 5.8118e-03, 2.4608e-05, 5.2603e-05, 3.6111e-02,\n",
      "        4.4646e-04, 5.6050e-03, 1.4926e-04, 1.9787e-03, 1.8020e-02, 2.2688e-05,\n",
      "        1.7017e-04, 8.5928e-03, 6.7141e-02, 7.5475e-04, 1.9912e-04, 1.6338e-03,\n",
      "        8.1120e-04, 1.3107e-02], device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.00112197/1.0000000\n",
      "grad_weights: tensor([-2.4042e-04, -2.8720e-04,  1.7628e-03, -5.7625e-05, -4.0638e-05,\n",
      "         7.3822e-03,  2.4095e-05, -1.2133e-03, -1.7463e-04,  9.4450e-05,\n",
      "         2.4218e-03, -1.1068e-04, -1.4304e-04, -1.7556e-04,  7.2801e-03,\n",
      "        -4.2067e-04, -1.1084e-07,  2.2502e-05, -3.6202e-04,  1.6305e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.00114225/1.0000000\n",
      "=====> Optimized acc: (tensor(-1.0000, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-14.3931, -14.8623, -15.7525, -11.3612, -13.3889, -15.8516, -15.4118,\n",
      "        -15.0321, -12.8474, -15.4351, -15.7832, -10.4666, -13.4057, -15.4529,\n",
      "        -15.6297, -13.8724, -15.3340, -15.6936, -14.1151, -15.6231],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.7, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0420,  0.0045,  0.0226, -0.0339,  0.0034,  0.0034,  0.0189, -0.0694,\n",
      "        -0.0992,  0.0019, -0.0554,  0.0002,  0.0002,  0.0012, -0.0492,  0.0038,\n",
      "         0.0031,  0.0156,  0.0166,  0.0404], device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.00122491/1.0000000\n",
      "grad_weights: tensor([ 0.0375,  0.0041,  0.0207, -0.0295,  0.0031,  0.0033,  0.0173, -0.0589,\n",
      "        -0.0850,  0.0018, -0.0486,  0.0001,  0.0002,  0.0011, -0.0415,  0.0034,\n",
      "         0.0027,  0.0145,  0.0173,  0.0379], device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.00119956/1.0000000\n",
      "grad_weights: tensor([ 0.0329,  0.0037,  0.0189, -0.0254,  0.0027,  0.0031,  0.0157, -0.0492,\n",
      "        -0.0718,  0.0017, -0.0413,  0.0001,  0.0001,  0.0010, -0.0344,  0.0031,\n",
      "         0.0024,  0.0132,  0.0177,  0.0349], device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.00117798/1.0000000\n",
      "grad_weights: tensor([ 0.0282,  0.0032,  0.0165, -0.0214,  0.0022,  0.0028,  0.0140, -0.0403,\n",
      "        -0.0596,  0.0016, -0.0344,  0.0001,  0.0001,  0.0009, -0.0279,  0.0027,\n",
      "         0.0020,  0.0119,  0.0178,  0.0319], device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.00116012/1.0000000\n",
      "grad_weights: tensor([ 2.3386e-02,  2.6956e-03,  1.3867e-02, -1.7700e-02,  1.8240e-03,\n",
      "         2.5479e-03,  1.2200e-02, -3.2067e-02, -4.8474e-02,  1.3972e-03,\n",
      "        -2.7960e-02,  9.2511e-05,  1.0591e-04,  7.5717e-04, -2.2103e-02,\n",
      "         2.3017e-03,  1.5855e-03,  1.0450e-02,  1.7432e-02,  2.8589e-02],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 500 | 993 ####, loss/acc = 0.00114586/1.0000000\n",
      "grad_weights: tensor([ 1.8693e-02,  2.1113e-03,  1.0972e-02, -1.4265e-02,  1.4037e-03,\n",
      "         2.2335e-03,  1.0359e-02, -2.4720e-02, -3.8294e-02,  1.1715e-03,\n",
      "        -2.1987e-02,  6.6943e-05,  8.0994e-05,  6.3028e-04, -1.6924e-02,\n",
      "         1.8739e-03,  1.2087e-03,  8.9704e-03,  1.6477e-02,  2.5141e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.00113504/1.0000000\n",
      "grad_weights: tensor([ 1.3690e-02,  1.4628e-03,  7.7130e-03, -1.1015e-02,  9.6842e-04,\n",
      "         1.8707e-03,  8.4317e-03, -1.8002e-02, -2.9000e-02,  8.9277e-04,\n",
      "        -1.6361e-02,  3.7378e-05,  4.8759e-05,  4.9896e-04, -1.2267e-02,\n",
      "         1.4308e-03,  8.3311e-04,  7.3896e-03,  1.4740e-02,  2.1510e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.00112745/1.0000000\n",
      "grad_weights: tensor([ 8.7526e-03,  7.7339e-04,  4.2843e-03, -8.0058e-03,  5.3272e-04,\n",
      "         1.5053e-03,  6.4442e-03, -1.1900e-02, -2.0626e-02,  5.6887e-04,\n",
      "        -1.1229e-02,  4.2129e-06,  9.9065e-06,  3.6655e-04, -8.0931e-03,\n",
      "         9.5253e-04,  4.6306e-04,  5.7408e-03,  1.2245e-02,  1.7709e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.00112280/1.0000000\n",
      "grad_weights: tensor([ 3.8552e-03,  4.0815e-05,  6.3373e-04, -5.1936e-03,  9.3137e-05,\n",
      "         1.0622e-03,  4.4216e-03, -6.4748e-03, -1.3089e-02,  2.0372e-04,\n",
      "        -6.4864e-03, -3.1794e-05, -3.5717e-05,  2.2878e-04, -4.4000e-03,\n",
      "         4.5264e-04,  9.3004e-05,  4.0528e-03,  8.9163e-03,  1.3807e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.00112071/1.0000000\n",
      "grad_weights: tensor([-8.4449e-04, -7.1604e-04, -3.1349e-03, -2.6521e-03, -3.3391e-04,\n",
      "         5.9562e-04,  2.4160e-03, -1.6787e-03, -6.4764e-03, -1.8635e-04,\n",
      "        -2.2334e-03, -7.0110e-05, -8.7296e-05,  9.9612e-05, -1.1800e-03,\n",
      "        -5.2258e-05, -2.4676e-04,  2.3656e-03,  4.7837e-03,  9.9066e-03],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(-0.4964, device='cuda:1'), 0.7, 0.4)\n",
      "=====> Optimized weights: tensor([-5.7384, -5.6974, -5.7354,  5.7565, -5.6370, -6.0591, -5.9447,  5.6164,\n",
      "         5.6928, -5.8964,  5.6957, -5.4049, -5.5085, -5.8755,  5.5923, -5.8170,\n",
      "        -5.6128, -5.9806, -6.2683, -6.0618], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.9, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 5.6269e-05,  3.8417e-02,  1.6174e-02,  3.5547e-03,  1.2168e-02,\n",
      "         1.1508e-03,  5.9630e-05,  3.0361e-02,  3.2637e-02, -1.3329e-01,\n",
      "         1.0228e-01,  1.1003e-03,  9.6606e-03, -4.8499e-02,  2.4051e-02,\n",
      "         3.3439e-02, -3.9054e-02,  3.5724e-02, -8.7684e-02,  1.2808e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00122793/1.0000000\n",
      "grad_weights: tensor([ 5.1798e-05,  3.6025e-02,  1.5692e-02,  3.6521e-03,  1.1806e-02,\n",
      "         1.0111e-03,  5.2582e-05,  2.7821e-02,  3.1305e-02, -1.1911e-01,\n",
      "         9.4806e-02,  1.0527e-03,  9.1456e-03, -4.2794e-02,  2.3056e-02,\n",
      "         3.1350e-02, -3.4175e-02,  3.4529e-02, -7.6326e-02,  1.1683e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00120456/1.0000000\n",
      "grad_weights: tensor([ 4.7122e-05,  3.3317e-02,  1.5072e-02,  3.7124e-03,  1.1298e-02,\n",
      "         8.7082e-04,  4.5195e-05,  2.5277e-02,  2.9743e-02, -1.0561e-01,\n",
      "         8.7129e-02,  9.9437e-04,  8.5698e-03, -3.7339e-02,  2.1861e-02,\n",
      "         2.9066e-02, -2.9574e-02,  3.3105e-02, -6.5889e-02,  1.0534e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00118396/1.0000000\n",
      "grad_weights: tensor([ 4.2213e-05,  3.0346e-02,  1.4333e-02,  3.7238e-03,  1.0682e-02,\n",
      "         7.2639e-04,  3.7421e-05,  2.2450e-02,  2.8355e-02, -9.2979e-02,\n",
      "         7.9614e-02,  9.2371e-04,  7.9229e-03, -3.2249e-02,  2.1551e-02,\n",
      "         2.6638e-02, -2.5253e-02,  3.1433e-02, -5.6412e-02,  9.3759e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00116609/1.0000000\n",
      "grad_weights: tensor([ 3.6931e-05,  2.6956e-02,  1.3400e-02,  3.6574e-03,  9.8786e-03,\n",
      "         5.7916e-04,  2.9012e-05,  1.9369e-02,  2.6215e-02, -8.1032e-02,\n",
      "         7.1991e-02,  8.3586e-04,  7.1855e-03, -2.7293e-02,  1.9867e-02,\n",
      "         2.3938e-02, -2.1120e-02,  2.9418e-02, -4.7621e-02,  8.1768e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00115091/1.0000000\n",
      "grad_weights: tensor([ 3.1343e-05,  2.3193e-02,  1.2313e-02,  3.5109e-03,  8.8894e-03,\n",
      "         4.2866e-04,  2.0051e-05,  1.6062e-02,  2.3747e-02, -6.9771e-02,\n",
      "         6.3415e-02,  7.3026e-04,  6.4240e-03, -2.2574e-02,  1.7897e-02,\n",
      "         2.1046e-02, -1.7227e-02,  2.7154e-02, -3.9716e-02,  6.9379e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00113834/1.0000000\n",
      "grad_weights: tensor([ 2.5624e-05,  1.9189e-02,  1.1037e-02,  3.2638e-03,  7.7208e-03,\n",
      "         2.7904e-04,  1.0930e-05,  1.2722e-02,  2.1032e-02, -5.9199e-02,\n",
      "         5.4993e-02,  6.1081e-04,  5.5517e-03, -1.8173e-02,  1.5737e-02,\n",
      "         1.8026e-02, -1.3869e-02,  2.4620e-02, -3.2524e-02,  5.7103e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00112831/1.0000000\n",
      "grad_weights: tensor([ 1.9541e-05,  1.4719e-02,  9.5369e-03,  2.8947e-03,  6.3338e-03,\n",
      "         1.2518e-04,  1.1689e-06,  9.1888e-03,  1.7989e-02, -4.9255e-02,\n",
      "         4.6321e-02,  4.7252e-04,  4.5698e-03, -1.3879e-02,  1.3533e-02,\n",
      "         1.4769e-02, -1.0464e-02,  2.2186e-02, -2.6059e-02,  4.4518e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00112066/1.0000000\n",
      "grad_weights: tensor([ 1.3375e-05,  1.0081e-02,  7.8714e-03,  2.3895e-03,  4.7412e-03,\n",
      "        -2.7203e-05, -8.6402e-06,  5.6116e-03,  1.4699e-02, -4.0103e-02,\n",
      "         3.7834e-02,  3.2235e-04,  3.5520e-03, -9.8960e-03,  1.0905e-02,\n",
      "         1.1408e-02, -7.3569e-03,  1.9135e-02, -2.0291e-02,  3.1981e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00111525/1.0000000\n",
      "grad_weights: tensor([ 6.9797e-06,  5.0944e-03,  6.1857e-03,  1.7213e-03,  2.9332e-03,\n",
      "        -1.8147e-04, -1.8885e-05,  1.8364e-03,  1.1085e-02, -3.1583e-02,\n",
      "         2.9158e-02,  1.4828e-04,  2.4377e-03, -6.1082e-03,  8.2755e-03,\n",
      "         7.8752e-03, -4.4138e-03,  1.5759e-02, -1.5099e-02,  1.9069e-03],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(-0.1955, device='cuda:1'), 0.9, 1.0)\n",
      "=====> Optimized weights: tensor([-3.7866, -3.9007, -4.0273, -4.1029, -3.9896, -3.5989, -3.4181, -3.8310,\n",
      "        -4.0087,  3.8762, -3.9480, -3.9311, -3.9622,  3.7990, -4.0157, -3.9411,\n",
      "         3.7752, -4.0395,  3.8015, -3.8655], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.8, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([-5.3793e-02,  1.0160e-02,  3.6157e-02,  6.6274e-04,  1.8116e-04,\n",
      "         8.7725e-05, -1.2063e-02, -5.7836e-02,  5.6705e-03,  3.4361e-02,\n",
      "         1.7652e-04,  3.9516e-03,  5.7632e-03,  8.9932e-03, -4.0192e-02,\n",
      "         8.3156e-04,  3.5742e-04, -3.6116e-02, -2.4745e-02,  2.0620e-02],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 540 | 993 ####, loss/acc = 0.00121744/1.0000000\n",
      "grad_weights: tensor([-4.6787e-02,  9.1118e-03,  3.2220e-02,  6.0611e-04,  1.2889e-04,\n",
      "         6.8759e-05, -9.3884e-03, -4.8474e-02,  5.4828e-03,  3.2684e-02,\n",
      "         1.5094e-04,  3.8243e-03,  5.1624e-03,  8.1995e-03, -3.2796e-02,\n",
      "         7.2578e-04,  3.3079e-04, -3.0923e-02, -2.0730e-02,  1.9182e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00118609/1.0000000\n",
      "grad_weights: tensor([-4.0148e-02,  8.0316e-03,  2.8033e-02,  5.3758e-04,  7.5067e-05,\n",
      "         4.9157e-05, -7.2865e-03, -3.9912e-02,  5.1464e-03,  3.0396e-02,\n",
      "         1.2364e-04,  3.5847e-03,  4.5231e-03,  7.2895e-03, -2.6212e-02,\n",
      "         6.1952e-04,  3.0002e-04, -2.6196e-02, -1.7132e-02,  1.7430e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00115991/1.0000000\n",
      "grad_weights: tensor([-3.3797e-02,  6.9559e-03,  2.3796e-02,  4.5975e-04,  2.0548e-05,\n",
      "         3.0023e-05, -5.5258e-03, -3.2135e-02,  4.6639e-03,  2.7647e-02,\n",
      "         9.5561e-05,  3.2504e-03,  3.8700e-03,  6.2738e-03, -2.0552e-02,\n",
      "         5.1230e-04,  2.6460e-04, -2.1906e-02, -1.3927e-02,  1.5455e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00113869/1.0000000\n",
      "grad_weights: tensor([-2.8224e-02,  5.8603e-03,  1.9448e-02,  3.6878e-04, -3.4617e-05,\n",
      "         9.9591e-06, -4.1060e-03, -2.5046e-02,  3.9820e-03,  2.4272e-02,\n",
      "         6.5940e-05,  2.8162e-03,  3.1922e-03,  5.1545e-03, -1.5674e-02,\n",
      "         4.0352e-04,  2.2404e-04, -1.7979e-02, -1.1106e-02,  1.3204e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00112226/1.0000000\n",
      "grad_weights: tensor([-2.2580e-02,  4.7369e-03,  1.5100e-02,  2.6425e-04, -9.0693e-05,\n",
      "        -1.0631e-05, -2.9612e-03, -1.8605e-02,  3.2432e-03,  2.0234e-02,\n",
      "         3.4742e-05,  2.2531e-03,  2.4848e-03,  4.1432e-03, -1.1403e-02,\n",
      "         2.9285e-04,  1.7783e-04, -1.4415e-02, -8.5762e-03,  1.0616e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00111036/1.0000000\n",
      "grad_weights: tensor([-1.7326e-02,  3.6004e-03,  1.0476e-02,  1.4331e-04, -1.4768e-04,\n",
      "        -3.1240e-05, -2.0510e-03, -1.2788e-02,  2.0815e-03,  1.5506e-02,\n",
      "         1.8486e-06,  1.5497e-03,  1.7450e-03,  2.7377e-03, -7.7561e-03,\n",
      "         1.8180e-04,  1.2559e-04, -1.1201e-02, -6.3499e-03,  8.0405e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00110260/1.0000000\n",
      "grad_weights: tensor([-1.2373e-02,  2.4651e-03,  5.7340e-03,  8.7889e-06, -2.0445e-04,\n",
      "        -5.2298e-05, -1.3234e-03, -7.5946e-03,  6.3739e-04,  1.0984e-02,\n",
      "        -3.1763e-05,  7.1809e-04,  9.8291e-04,  1.4021e-03, -4.5975e-03,\n",
      "         6.9710e-05,  6.7754e-05, -8.3333e-03, -4.3911e-03,  4.9104e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00109853/1.0000000\n",
      "grad_weights: tensor([-7.8516e-03,  1.3493e-03,  1.0281e-03, -1.3522e-04, -2.6086e-04,\n",
      "        -7.2858e-05, -7.5315e-04, -3.0474e-03, -1.0736e-03,  5.1593e-03,\n",
      "        -6.5569e-05, -2.4144e-04,  2.3267e-04, -1.6185e-04, -1.9656e-03,\n",
      "        -3.6927e-05,  6.6564e-06, -5.8326e-03, -2.6925e-03,  1.5967e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00109748/1.0000000\n",
      "grad_weights: tensor([-3.7485e-03,  2.4990e-04, -3.5982e-03, -2.8873e-04, -3.1546e-04,\n",
      "        -9.3373e-05, -3.0488e-04,  9.9025e-04, -3.0220e-03, -1.0868e-03,\n",
      "        -9.9844e-05, -1.3096e-03, -5.1801e-04, -1.7921e-03,  2.5272e-04,\n",
      "        -1.4235e-04, -5.7605e-05, -3.5819e-03, -1.2220e-03, -1.8799e-03],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(-0.4764, device='cuda:1'), 0.8, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([  9.9905, -10.0694,  -9.8203,  -9.3987,  -3.3922,  -5.9677,   9.3174,\n",
      "          9.5965,  -9.7879, -10.2837,  -8.3748,  -9.9769,  -9.8680,  -9.8291,\n",
      "          9.4576,  -9.5291,  -9.9389,   9.9620,   9.7507, -10.0924],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.7, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 1.2182e-02,  1.3593e-01, -2.2488e-02,  4.1743e-03,  5.6208e-02,\n",
      "         1.0321e-03,  4.8923e-04,  1.1636e-03,  5.3568e-04,  8.4433e-03,\n",
      "         1.1451e-03,  2.6375e-04,  6.6752e-04,  3.2071e-04,  1.5836e-03,\n",
      "         1.0863e-02,  8.2738e-04,  9.5906e-05,  3.7728e-02,  5.1954e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.00110889/1.0000000\n",
      "grad_weights: tensor([ 1.2210e-03,  4.5220e-02, -4.6053e-03,  5.7850e-05,  1.6764e-02,\n",
      "         4.3573e-05,  9.6674e-05, -3.3242e-04,  6.8288e-05,  1.1072e-03,\n",
      "        -3.7693e-04, -6.8377e-06,  1.8337e-05, -1.2461e-04,  4.4536e-05,\n",
      "         1.6411e-03, -7.0429e-05,  2.5808e-06,  2.1241e-02, -1.9744e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.00117051/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.2631, device='cuda:1'), 0.7, 1.0)\n",
      "=====> Optimized weights: tensor([-15.2023, -16.3371,  15.7690, -14.6699, -16.1981, -14.8367, -15.6961,\n",
      "        -12.5613, -15.3261, -15.3780, -12.2463, -14.3508, -14.7350, -11.7924,\n",
      "        -14.7541, -15.4883, -13.9924, -14.5796, -17.0201, -11.6496],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0034, -0.0270,  0.0084,  0.0209,  0.0053, -0.1235,  0.0185,  0.0208,\n",
      "         0.0020, -0.0185,  0.0004,  0.0144,  0.0024,  0.0007,  0.0463,  0.0077,\n",
      "         0.0072,  0.0143,  0.0020,  0.0008], device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.00121333/1.0000000\n",
      "grad_weights: tensor([ 0.0030, -0.0211,  0.0078,  0.0178,  0.0050, -0.0987,  0.0156,  0.0192,\n",
      "         0.0018, -0.0139,  0.0003,  0.0134,  0.0021,  0.0007,  0.0436,  0.0071,\n",
      "         0.0065,  0.0140,  0.0019,  0.0007], device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.00118067/1.0000000\n",
      "grad_weights: tensor([ 0.0026, -0.0160,  0.0070,  0.0147,  0.0045, -0.0753,  0.0125,  0.0170,\n",
      "         0.0016, -0.0100,  0.0003,  0.0119,  0.0017,  0.0006,  0.0402,  0.0063,\n",
      "         0.0057,  0.0131,  0.0017,  0.0006], device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.00115582/1.0000000\n",
      "grad_weights: tensor([ 0.0021, -0.0117,  0.0059,  0.0114,  0.0036, -0.0541,  0.0097,  0.0143,\n",
      "         0.0013, -0.0068,  0.0002,  0.0098,  0.0014,  0.0005,  0.0354,  0.0052,\n",
      "         0.0047,  0.0115,  0.0013,  0.0005], device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.00113854/1.0000000\n",
      "grad_weights: tensor([ 0.0015, -0.0080,  0.0046,  0.0081,  0.0023, -0.0348,  0.0064,  0.0108,\n",
      "         0.0010, -0.0042,  0.0001,  0.0069,  0.0010,  0.0004,  0.0294,  0.0037,\n",
      "         0.0035,  0.0088,  0.0008,  0.0003], device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.00112839/1.0000000\n",
      "grad_weights: tensor([ 9.0592e-04, -4.9689e-03,  3.1128e-03,  4.5766e-03,  4.4729e-04,\n",
      "        -1.7290e-02,  3.0449e-03,  6.7511e-03,  7.1951e-04, -2.0245e-03,\n",
      "         4.6355e-05,  3.2059e-03,  6.5255e-04,  1.7447e-04,  2.2163e-02,\n",
      "         1.8363e-03,  1.9931e-03,  4.8779e-03, -7.0020e-05,  8.5130e-05],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 580 | 993 ####, loss/acc = 0.00112457/1.0000000\n",
      "grad_weights: tensor([ 2.3934e-04, -2.4443e-03,  1.1583e-03,  1.0344e-03, -1.9431e-03,\n",
      "        -1.6495e-03, -3.4156e-04,  2.0104e-03,  3.7455e-04, -2.5578e-04,\n",
      "        -5.3094e-05, -1.2863e-03,  2.9051e-04, -8.4295e-05,  1.3781e-02,\n",
      "        -4.2422e-04,  3.4222e-04, -3.0764e-04, -1.1445e-03, -1.3354e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.00112586/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5008, device='cuda:1'), 0.8, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-8.4622,  8.1671, -8.6381, -8.3570, -8.2086,  8.1077, -8.2478, -8.5818,\n",
      "        -8.6165,  7.9332, -8.1977, -8.4401, -8.4552, -8.4658, -8.7738, -8.4565,\n",
      "        -8.5045, -8.6217, -7.9906, -8.1460], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190]\n",
      "reset tmp model\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.9, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0047,  0.0024,  0.0283,  0.0356,  0.0006,  0.0022,  0.0127, -0.1805,\n",
      "         0.0037,  0.0145,  0.0017, -0.0420,  0.0018,  0.0108, -0.0558,  0.0188,\n",
      "        -0.1203,  0.0177,  0.0303,  0.0002], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00121200/1.0000000\n",
      "grad_weights: tensor([ 0.0040,  0.0021,  0.0248,  0.0382,  0.0004,  0.0020,  0.0116, -0.1292,\n",
      "         0.0033,  0.0134,  0.0013, -0.0331,  0.0015,  0.0097, -0.0441,  0.0177,\n",
      "        -0.0962,  0.0157,  0.0262,  0.0002], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00117805/1.0000000\n",
      "grad_weights: tensor([ 0.0033,  0.0018,  0.0212,  0.0391,  0.0003,  0.0017,  0.0101, -0.0883,\n",
      "         0.0028,  0.0120,  0.0010, -0.0255,  0.0012,  0.0084, -0.0339,  0.0160,\n",
      "        -0.0744,  0.0133,  0.0218,  0.0002], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00115196/1.0000000\n",
      "grad_weights: tensor([ 0.0026,  0.0015,  0.0175,  0.0378,  0.0002,  0.0013,  0.0087, -0.0574,\n",
      "         0.0023,  0.0104,  0.0006, -0.0189,  0.0009,  0.0068, -0.0250,  0.0139,\n",
      "        -0.0546,  0.0106,  0.0172,  0.0002], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00113329/1.0000000\n",
      "grad_weights: tensor([ 1.9418e-03,  1.0798e-03,  1.3650e-02,  3.3306e-02,  1.9096e-05,\n",
      "         8.8029e-04,  6.6171e-03, -3.4800e-02,  1.7749e-03,  8.6383e-03,\n",
      "         2.1464e-04, -1.3337e-02,  6.3794e-04,  4.7851e-03, -1.7187e-02,\n",
      "         1.1021e-02, -3.6768e-02,  7.3559e-03,  1.2506e-02,  1.6649e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00112150/1.0000000\n",
      "grad_weights: tensor([ 1.2675e-03,  5.7114e-04,  9.7340e-03,  2.5024e-02, -1.1684e-04,\n",
      "         3.3950e-04,  4.2048e-03, -1.8713e-02,  1.1709e-03,  6.6396e-03,\n",
      "        -1.4257e-04, -8.5712e-03,  3.2143e-04,  2.3981e-03, -1.0394e-02,\n",
      "         7.5357e-03, -2.0858e-02,  3.7532e-03,  7.6541e-03,  9.6583e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00111572/1.0000000\n",
      "grad_weights: tensor([ 6.0885e-04, -1.6271e-05,  5.7993e-03,  1.2705e-02, -2.4928e-04,\n",
      "        -2.8774e-04,  1.4670e-03, -7.6207e-03,  5.3610e-04,  4.4670e-03,\n",
      "        -4.8659e-04, -4.5881e-03, -4.9448e-06, -3.6816e-04, -4.5598e-03,\n",
      "         3.4310e-03, -6.8783e-03, -2.1086e-04,  2.7466e-03, -1.4117e-06],\n",
      "       device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00111491/1.0000000\n",
      "grad_weights: tensor([-2.8911e-05, -6.6495e-04,  1.9158e-03, -3.2546e-03, -3.7789e-04,\n",
      "        -9.8354e-04, -1.5034e-03, -1.8424e-04, -1.1933e-04,  2.1770e-03,\n",
      "        -8.1512e-04, -1.2259e-03, -3.3255e-04, -3.4112e-03,  4.0560e-04,\n",
      "        -1.2024e-03,  5.1970e-03, -4.4347e-03, -2.1470e-03, -1.2746e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00111767/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5936, device='cuda:1'), 0.8, 0.5)\n",
      "=====> Optimized weights: tensor([-5.6611, -5.5778, -5.7932, -6.0391, -4.3084, -5.3935, -5.7453,  5.1964,\n",
      "        -5.7327, -5.9390, -4.7225,  5.5179, -5.4760, -5.5406,  5.4792, -5.8397,\n",
      "         5.4558, -5.5335, -5.6294, -5.6819], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.7, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0107,  0.0106,  0.0026,  0.0064, -0.0476,  0.0006,  0.0144,  0.0341,\n",
      "         0.0045, -0.0407,  0.0132,  0.0031, -0.0280, -0.1268,  0.0138, -0.0337,\n",
      "         0.0026,  0.0008,  0.0167,  0.0069], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00121778/1.0000000\n",
      "grad_weights: tensor([ 0.0094,  0.0093,  0.0024,  0.0056, -0.0380,  0.0005,  0.0131,  0.0319,\n",
      "         0.0041, -0.0337,  0.0122,  0.0030, -0.0222, -0.0944,  0.0124, -0.0283,\n",
      "         0.0024,  0.0006,  0.0161,  0.0060], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00118715/1.0000000\n",
      "grad_weights: tensor([ 0.0081,  0.0078,  0.0022,  0.0048, -0.0297,  0.0005,  0.0118,  0.0285,\n",
      "         0.0036, -0.0272,  0.0111,  0.0029, -0.0174, -0.0686,  0.0110, -0.0233,\n",
      "         0.0021,  0.0005,  0.0150,  0.0051], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00116212/1.0000000\n",
      "grad_weights: tensor([ 0.0068,  0.0062,  0.0019,  0.0038, -0.0225,  0.0004,  0.0105,  0.0245,\n",
      "         0.0031, -0.0213,  0.0098,  0.0026, -0.0134, -0.0486,  0.0095, -0.0186,\n",
      "         0.0017,  0.0003,  0.0135,  0.0042], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00114252/1.0000000\n",
      "grad_weights: tensor([ 0.0055,  0.0046,  0.0015,  0.0028, -0.0165,  0.0003,  0.0092,  0.0203,\n",
      "         0.0026, -0.0160,  0.0084,  0.0022, -0.0101, -0.0336,  0.0079, -0.0143,\n",
      "         0.0014,  0.0002,  0.0114,  0.0032], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00112799/1.0000000\n",
      "grad_weights: tensor([ 4.1984e-03,  2.7222e-03,  1.0902e-03,  1.7712e-03, -1.1438e-02,\n",
      "         1.5060e-04,  7.9953e-03,  1.5652e-02,  2.0801e-03, -1.1188e-02,\n",
      "         6.9204e-03,  1.7544e-03, -7.3655e-03, -2.2407e-02,  6.2133e-03,\n",
      "        -1.0569e-02,  1.0238e-03,  2.1236e-05,  8.8807e-03,  2.1121e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00111811/1.0000000\n",
      "grad_weights: tensor([ 2.9164e-03,  7.5915e-04,  6.1248e-04,  6.6158e-04, -7.1651e-03,\n",
      "         2.9956e-05,  6.7448e-03,  1.1381e-02,  1.5248e-03, -6.7433e-03,\n",
      "         5.2984e-03,  1.1572e-03, -5.1250e-03, -1.4209e-02,  4.4775e-03,\n",
      "        -6.9965e-03,  6.4519e-04, -1.4515e-04,  5.7358e-03,  9.9871e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00111232/1.0000000\n",
      "grad_weights: tensor([ 1.7070e-03, -1.2815e-03,  8.5888e-05, -4.7751e-04, -3.6326e-03,\n",
      "        -9.8735e-05,  5.5700e-03,  6.2149e-03,  9.6295e-04, -2.8209e-03,\n",
      "         3.6091e-03,  4.3687e-04, -3.3677e-03, -8.3796e-03,  2.6399e-03,\n",
      "        -3.7893e-03,  2.5082e-04, -3.1233e-04,  2.0476e-03, -1.3973e-04],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 620 | 993 ####, loss/acc = 0.00110993/1.0000000\n",
      "grad_weights: tensor([ 0.0005, -0.0033, -0.0005, -0.0016, -0.0007, -0.0002,  0.0045,  0.0010,\n",
      "         0.0004,  0.0007,  0.0019, -0.0004, -0.0019, -0.0042,  0.0008, -0.0009,\n",
      "        -0.0001, -0.0005, -0.0020, -0.0013], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00111013/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3981, device='cuda:1'), 0.9, 0.8)\n",
      "=====> Optimized weights: tensor([-7.6381, -7.1234, -7.5739, -7.2144,  7.2407, -7.0525, -7.9941, -7.7543,\n",
      "        -7.7763,  7.3320, -7.8874, -7.8065,  7.3300,  6.9976, -7.7497,  7.4503,\n",
      "        -7.5802, -6.1267, -7.7715, -7.3330], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0062,  0.0352,  0.0308,  0.0146,  0.0016,  0.0071,  0.0216,  0.0013,\n",
      "         0.0073,  0.0078,  0.0002,  0.0129, -0.0028,  0.0007, -0.1292,  0.0093,\n",
      "         0.0485,  0.0004,  0.0105,  0.0527], device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00120755/1.0000000\n",
      "grad_weights: tensor([ 0.0054,  0.0308,  0.0272,  0.0125,  0.0014,  0.0061,  0.0192,  0.0010,\n",
      "         0.0064,  0.0070,  0.0001,  0.0113, -0.0023,  0.0006, -0.0979,  0.0086,\n",
      "         0.0428,  0.0003,  0.0093,  0.0456], device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00117111/1.0000000\n",
      "grad_weights: tensor([ 4.5320e-03,  2.5960e-02,  2.2609e-02,  1.0093e-02,  1.1592e-03,\n",
      "         4.9963e-03,  1.6225e-02,  7.7144e-04,  5.1525e-03,  6.1137e-03,\n",
      "         8.8320e-05,  9.4907e-03, -1.7810e-03,  4.9675e-04, -7.3151e-02,\n",
      "         7.5394e-03,  3.6179e-02,  2.3861e-04,  7.8493e-03,  3.7611e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00114447/1.0000000\n",
      "grad_weights: tensor([ 3.4608e-03,  2.0830e-02,  1.6750e-02,  7.5174e-03,  9.0459e-04,\n",
      "         3.6941e-03,  1.2723e-02,  4.6967e-04,  3.6443e-03,  5.0735e-03,\n",
      "         3.6113e-05,  7.2073e-03, -1.3413e-03,  3.6369e-04, -4.9667e-02,\n",
      "         5.7963e-03,  2.8422e-02,  1.5846e-04,  5.9025e-03,  2.8454e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00112728/1.0000000\n",
      "grad_weights: tensor([ 2.2296e-03,  1.5294e-02,  9.7570e-03,  4.3512e-03,  6.1974e-04,\n",
      "         2.2312e-03,  8.9098e-03,  1.3628e-04,  1.8299e-03,  3.9105e-03,\n",
      "        -1.6530e-05,  4.8146e-03, -9.4706e-04,  1.8709e-04, -2.9793e-02,\n",
      "         3.2787e-03,  1.9649e-02,  7.3581e-05,  3.4840e-03,  1.8302e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00111887/1.0000000\n",
      "grad_weights: tensor([ 8.3704e-04,  9.5091e-03,  1.5857e-03,  1.1509e-03,  3.0415e-04,\n",
      "         6.2726e-04,  4.4033e-03, -2.2991e-04, -1.8770e-04,  2.6051e-03,\n",
      "        -6.8548e-05,  1.7522e-03, -5.9782e-04, -2.9238e-05, -1.3435e-02,\n",
      "         2.1946e-04,  9.8291e-03, -1.2643e-05,  5.5700e-04,  7.3336e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00111792/1.0000000\n",
      "grad_weights: tensor([-6.6850e-04,  3.6998e-03, -7.3970e-03, -2.5329e-03, -2.7812e-05,\n",
      "        -1.0521e-03, -4.6218e-04, -6.1306e-04, -2.5197e-03,  1.2063e-03,\n",
      "        -1.1918e-04, -1.6025e-03, -2.9565e-04, -2.8100e-04, -4.4344e-04,\n",
      "        -3.8401e-03, -4.7217e-04, -9.8482e-05, -2.7518e-03, -3.9801e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00112216/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5984, device='cuda:1'), 0.8, 0.5)\n",
      "=====> Optimized weights: tensor([-8.1544, -8.3882, -8.0006, -8.0064, -8.2530, -8.0382, -8.2919, -7.2718,\n",
      "        -7.7951, -8.5049, -6.3586, -8.1620,  8.1973, -7.7931,  7.8874, -7.9918,\n",
      "        -8.2885, -7.6346, -8.0166, -8.1506], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 2.5765e-02,  1.6292e-04,  1.0102e-03,  4.9484e-03,  1.1931e-04,\n",
      "         3.6527e-03,  1.2945e-03,  4.1590e-02,  5.6861e-02,  1.1442e-02,\n",
      "         5.0901e-03,  1.8976e-04,  6.1987e-03,  1.0158e-04,  2.7584e-03,\n",
      "         5.9835e-03,  3.7530e-04,  2.2005e-02, -1.0218e-01,  6.9376e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.00119973/1.0000000\n",
      "grad_weights: tensor([ 2.4204e-02,  9.8968e-05,  9.4149e-04,  4.2667e-03,  1.0103e-04,\n",
      "         3.0525e-03,  9.9246e-04,  3.5311e-02,  4.7960e-02,  1.0323e-02,\n",
      "         4.3028e-03,  1.8050e-04,  5.4518e-03,  8.6861e-05,  2.4675e-03,\n",
      "         4.9549e-03,  2.8556e-04,  1.9415e-02, -7.5893e-02,  5.5968e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.00115740/1.0000000\n",
      "grad_weights: tensor([ 2.1443e-02,  3.1649e-05,  8.2522e-04,  3.3735e-03,  7.8269e-05,\n",
      "         2.3950e-03,  6.9459e-04,  2.8401e-02,  3.8774e-02,  8.7673e-03,\n",
      "         3.4568e-03,  1.5970e-04,  4.5256e-03,  7.0367e-05,  2.0767e-03,\n",
      "         3.8736e-03,  1.9355e-04,  1.6205e-02, -5.6052e-02,  4.2531e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.00112661/1.0000000\n",
      "grad_weights: tensor([ 1.7178e-02, -3.9895e-05,  6.4772e-04,  2.2571e-03,  5.0375e-05,\n",
      "         1.6608e-03,  3.8164e-04,  2.0911e-02,  2.9386e-02,  6.7160e-03,\n",
      "         2.5331e-03,  1.2386e-04,  3.3629e-03,  5.1888e-05,  1.5535e-03,\n",
      "         2.7445e-03,  9.8347e-05,  1.2390e-02, -3.8060e-02,  2.8721e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.00110677/1.0000000\n",
      "grad_weights: tensor([ 1.1160e-02, -1.1636e-04,  3.9517e-04,  8.4782e-04,  1.7768e-05,\n",
      "         8.4373e-04,  6.2784e-05,  1.2872e-02,  1.9698e-02,  4.0502e-03,\n",
      "         1.5518e-03,  6.6550e-05,  2.1471e-03,  3.1003e-05,  8.7722e-04,\n",
      "         1.5485e-03, -1.6759e-06,  7.8301e-03, -2.3668e-02,  1.4551e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.00109693/1.0000000\n",
      "grad_weights: tensor([ 3.3786e-03, -1.9069e-04,  5.2820e-05, -7.9461e-04, -2.2590e-05,\n",
      "        -4.0797e-05, -2.5701e-04,  4.1916e-03,  9.8162e-03,  8.2389e-04,\n",
      "         4.9523e-04, -1.6082e-05,  4.7160e-04,  8.2003e-06,  4.5161e-05,\n",
      "         3.1478e-04, -1.0233e-04,  2.5963e-03, -1.2655e-02,  3.0629e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.00109543/1.0000000\n",
      "grad_weights: tensor([-6.0779e-03, -2.7158e-04, -3.7669e-04, -2.7436e-03, -6.8241e-05,\n",
      "        -9.7001e-04, -5.7016e-04, -4.7560e-03,  1.3391e-04, -2.9424e-03,\n",
      "        -6.0701e-04, -1.2464e-04, -1.4094e-03, -1.6248e-05, -9.2922e-04,\n",
      "        -9.2739e-04, -2.0366e-04, -3.1691e-03, -4.2468e-03, -1.3689e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.00109961/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4761, device='cuda:1'), 0.9, 1.0)\n",
      "=====> Optimized weights: tensor([-12.9071,  -5.4476, -12.6552, -11.7239, -11.4451, -12.2130, -11.0956,\n",
      "        -12.6417, -12.8551, -12.6736, -12.6185, -12.2130, -12.6363, -12.4398,\n",
      "        -12.4810, -12.4166, -10.6670, -12.7744,  12.4069, -12.1679],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([4.0379e-03, 2.0304e-03, 1.2485e-02, 1.0368e-02, 1.0164e-01, 1.2518e-01,\n",
      "        4.2645e-03, 1.8234e-06, 9.1836e-03, 5.2436e-04, 1.1406e-04, 3.4115e-04,\n",
      "        1.8804e-04, 2.2376e-02, 7.3153e-05, 3.5932e-04, 2.5503e-02, 2.2738e-02,\n",
      "        7.8256e-03, 4.6068e-03], device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.00118511/1.0000000\n",
      "grad_weights: tensor([ 3.0284e-03,  1.3071e-03,  9.6673e-03,  7.2664e-03,  8.1717e-02,\n",
      "         1.0244e-01,  3.3073e-03, -5.7779e-05,  9.1668e-03,  4.8550e-04,\n",
      "         8.6531e-05,  2.3902e-04,  2.0556e-04,  1.6741e-02,  2.7214e-05,\n",
      "         2.5129e-04,  1.8128e-02,  1.7652e-02,  8.0047e-03,  3.2014e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.00114402/1.0000000\n",
      "grad_weights: tensor([ 1.9555e-03,  4.8791e-04,  6.3744e-03,  3.7985e-03,  4.6764e-02,\n",
      "         6.6406e-02,  2.0079e-03, -1.2104e-04,  7.5821e-03,  3.7240e-04,\n",
      "         4.2486e-05,  1.0131e-04,  1.7801e-04,  8.7666e-03, -2.2548e-05,\n",
      "         1.0455e-04,  1.0057e-02,  1.1583e-02,  6.4677e-03,  1.7476e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.00112980/1.0000000\n",
      "grad_weights: tensor([ 7.8799e-04, -4.7149e-04,  2.7461e-03, -2.4079e-04, -3.8571e-03,\n",
      "         1.8193e-02, -2.2746e-04, -1.8912e-04,  3.1258e-03,  9.5853e-05,\n",
      "        -2.1422e-05, -8.4344e-05,  3.9657e-05, -2.3425e-03, -7.7610e-05,\n",
      "        -9.8886e-05,  1.0585e-03,  4.3427e-03,  1.7172e-03,  2.1569e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.00113818/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6847, device='cuda:1'), 0.8, 0.0)\n",
      "=====> Optimized weights: tensor([-8.8300, -7.9829, -8.8824, -8.4726, -8.6126, -8.8521, -8.5947,  4.0336,\n",
      "        -9.1484, -8.9881, -8.2374, -8.0793, -9.0428, -8.4403, -5.1946, -8.0349,\n",
      "        -8.5815, -8.8600, -9.0730, -8.5578], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 7.2122e-05,  2.2243e-02, -2.8349e-02, -4.0041e-02,  2.3881e-02,\n",
      "        -8.2115e-02,  6.6619e-04,  6.7768e-03,  3.1960e-03,  2.7233e-03,\n",
      "         2.1551e-03,  1.3167e-01,  4.4440e-05,  6.6562e-02,  5.6042e-03,\n",
      "         6.2041e-04,  6.3865e-03, -5.3215e-02,  1.0051e-02,  3.0778e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.00118783/1.0000000\n",
      "grad_weights: tensor([ 6.3447e-05,  1.7242e-02, -1.9449e-02, -2.6730e-02,  1.8122e-02,\n",
      "        -4.8357e-02,  5.0120e-04,  5.2902e-03,  2.4283e-03,  2.2643e-03,\n",
      "         1.7423e-03,  1.1953e-01,  3.4162e-05,  5.5937e-02,  4.7753e-03,\n",
      "         5.7506e-04,  4.8404e-03, -3.3432e-02,  7.7496e-03,  2.1511e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.00114238/1.0000000\n",
      "grad_weights: tensor([ 4.6950e-05,  1.1698e-02, -1.1889e-02, -1.6467e-02,  1.1615e-02,\n",
      "        -2.5652e-02,  2.9848e-04,  3.8715e-03,  1.6269e-03,  1.6373e-03,\n",
      "         1.2873e-03,  9.6945e-02,  2.1800e-05,  4.1689e-02,  3.6611e-03,\n",
      "         4.3745e-04,  3.1344e-03, -1.8425e-02,  5.3568e-03,  1.1783e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.00111631/1.0000000\n",
      "grad_weights: tensor([ 1.9238e-05,  5.6150e-03, -5.4018e-03, -7.8385e-03,  4.3461e-03,\n",
      "        -1.1060e-02,  5.1441e-05,  2.4806e-03,  8.0022e-04,  8.0566e-04,\n",
      "         7.5065e-04,  6.4453e-02,  7.1585e-06,  2.4640e-02,  2.0803e-03,\n",
      "         1.6009e-04,  1.3003e-03, -7.3100e-03,  2.8188e-03,  1.6405e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.00110742/1.0000000\n",
      "grad_weights: tensor([-2.1683e-05, -9.9329e-04,  9.1410e-05, -9.8275e-04, -3.4965e-03,\n",
      "        -2.0146e-03, -2.1375e-04,  1.1270e-03, -5.0617e-05, -2.4179e-04,\n",
      "         1.5154e-04,  2.3903e-02, -9.8651e-06,  4.3195e-03,  9.4938e-05,\n",
      "        -3.0909e-04, -6.5631e-04,  8.3326e-04,  1.7137e-04, -8.9064e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.00111179/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.7031, device='cuda:1'), 0.8, 0.5)\n",
      "=====> Optimized weights: tensor([-6.9012, -7.0787,  6.9293,  6.9367, -6.9087,  6.7092, -6.6161, -7.3168,\n",
      "        -7.0770, -7.1419, -7.2700, -7.4753, -6.6509, -7.3040, -7.2907, -6.8916,\n",
      "        -6.9628,  6.7536, -7.1448, -6.5268], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.9, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 4.6986e-04,  8.2193e-05,  1.6182e-02,  8.4260e-03,  4.8594e-04,\n",
      "        -3.5328e-02,  4.0937e-03,  6.4879e-04,  3.9460e-03,  2.3360e-04,\n",
      "         6.0736e-04, -1.4765e-01,  1.0955e-02, -1.4093e-01,  1.9307e-03,\n",
      "         5.9147e-03,  1.7895e-02,  1.5899e-03,  1.6375e-02,  2.8378e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.00116757/1.0000000\n",
      "grad_weights: tensor([ 2.8191e-04,  3.2101e-05,  1.3818e-02,  5.5013e-03,  2.8708e-04,\n",
      "        -1.9199e-02,  2.5341e-03,  5.2812e-04,  2.8332e-03,  1.6032e-04,\n",
      "         5.3462e-04, -7.5609e-02,  9.0249e-03, -8.3596e-02,  1.2291e-03,\n",
      "         3.8369e-03,  1.2859e-02,  1.2175e-03,  1.1098e-02,  1.1330e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.00111912/1.0000000\n",
      "grad_weights: tensor([ 6.9687e-05, -2.1488e-05,  9.8469e-03,  2.7701e-03,  8.0859e-05,\n",
      "        -8.3281e-03,  8.2745e-04,  2.8792e-04,  1.4974e-03,  5.7621e-05,\n",
      "         2.7477e-04, -3.2094e-02,  5.2002e-03, -4.2582e-02,  5.0709e-04,\n",
      "         1.5323e-03,  7.8315e-03,  5.5497e-04,  5.6536e-03, -6.0802e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.00110290/1.0000000\n",
      "grad_weights: tensor([-1.6691e-04, -7.9186e-05,  3.8845e-03,  1.7083e-04, -1.3921e-04,\n",
      "        -1.0043e-03, -1.0357e-03, -1.1709e-04, -7.2408e-05, -8.4564e-05,\n",
      "        -2.9810e-04, -6.9043e-03, -1.3205e-03, -6.5598e-03, -2.7204e-04,\n",
      "        -1.0224e-03,  2.7692e-03, -5.7191e-04,  4.6219e-05, -2.4723e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.00110968/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6830, device='cuda:1'), 0.7, 0.3333333333333333)\n",
      "=====> Optimized weights: tensor([-8.1962, -5.8795, -9.7117, -9.1175, -8.3236,  8.8544, -8.5003, -9.1080,\n",
      "        -9.1893, -8.4578, -8.7484,  8.7976, -9.2347,  9.0511, -8.7864, -8.7526,\n",
      "        -9.4453, -8.7316, -9.1416, -6.2054], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.9, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 740 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0011,  0.0094,  0.0010, -0.0029,  0.0257,  0.0003,  0.0049,  0.0501,\n",
      "         0.0003,  0.0226, -0.0395, -0.1506,  0.0003,  0.0149,  0.0003,  0.0267,\n",
      "         0.0232,  0.0232, -0.0174,  0.0050], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.00121317/1.0000000\n",
      "grad_weights: tensor([ 0.0009,  0.0083,  0.0008, -0.0023,  0.0227,  0.0003,  0.0045,  0.0461,\n",
      "         0.0002,  0.0217, -0.0323, -0.1212,  0.0003,  0.0133,  0.0002,  0.0242,\n",
      "         0.0197,  0.0194, -0.0126,  0.0045], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.00117983/1.0000000\n",
      "grad_weights: tensor([ 0.0008,  0.0071,  0.0006, -0.0019,  0.0194,  0.0002,  0.0039,  0.0406,\n",
      "         0.0002,  0.0199, -0.0257, -0.0944,  0.0002,  0.0115,  0.0002,  0.0211,\n",
      "         0.0160,  0.0154, -0.0089,  0.0039], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.00115392/1.0000000\n",
      "grad_weights: tensor([ 5.7284e-04,  5.9349e-03,  3.1688e-04, -1.4664e-03,  1.6020e-02,\n",
      "         1.9413e-04,  3.1650e-03,  3.3605e-02,  9.6871e-05,  1.7342e-02,\n",
      "        -1.9878e-02, -7.0423e-02,  1.5113e-04,  9.3788e-03,  9.5171e-05,\n",
      "         1.7072e-02,  1.2375e-02,  1.1279e-02, -6.1117e-03,  3.2982e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.00113513/1.0000000\n",
      "grad_weights: tensor([ 3.6682e-04,  4.7440e-03,  5.7685e-05, -1.1069e-03,  1.2417e-02,\n",
      "         1.4862e-04,  2.2631e-03,  2.4971e-02,  2.6175e-05,  1.3603e-02,\n",
      "        -1.4650e-02, -4.9551e-02,  7.3339e-05,  7.0155e-03,  3.0945e-05,\n",
      "         1.2412e-02,  8.6969e-03,  7.0091e-03, -3.9488e-03,  2.5749e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.00112311/1.0000000\n",
      "grad_weights: tensor([ 1.5012e-04,  3.5344e-03, -2.1563e-04, -7.9469e-04,  8.6914e-03,\n",
      "         8.5891e-05,  1.1690e-03,  1.4888e-02, -4.4426e-05,  8.6947e-03,\n",
      "        -9.9495e-03, -3.1444e-02, -1.4603e-05,  4.4281e-03, -3.7375e-05,\n",
      "         6.5248e-03,  5.0195e-03,  2.5831e-03, -2.3360e-03,  1.7793e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.00111716/1.0000000\n",
      "grad_weights: tensor([-7.6696e-05,  2.3054e-03, -5.0510e-04, -5.2578e-04,  4.8178e-03,\n",
      "         6.7521e-06, -1.0090e-04,  3.4689e-03, -1.1580e-04,  2.5725e-03,\n",
      "        -5.7857e-03, -1.6112e-02, -1.1250e-04,  1.7094e-03, -1.0996e-04,\n",
      "         5.7686e-05,  1.3504e-03, -1.9247e-03, -1.1295e-03,  9.1582e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.00111626/1.0000000\n",
      "grad_weights: tensor([-3.0386e-04,  1.1479e-03, -7.9305e-04, -3.0931e-04,  9.6491e-04,\n",
      "        -8.6485e-05, -1.4909e-03, -8.7522e-03, -1.8391e-04, -4.5259e-03,\n",
      "        -2.2107e-03, -3.6208e-03, -2.1707e-04, -1.2686e-03, -1.8314e-04,\n",
      "        -7.3531e-03, -2.1428e-03, -6.3351e-03, -2.4504e-04,  1.0969e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.00111881/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3934, device='cuda:1'), 0.7, 0.5)\n",
      "=====> Optimized weights: tensor([-7.2581, -7.9060, -5.8733,  7.6815, -7.8215, -7.6556, -7.5313, -7.6987,\n",
      "        -6.1063, -7.8356,  7.6175,  7.4951, -6.6038, -7.7225, -6.1715, -7.5639,\n",
      "        -7.5195, -7.1885,  7.1700, -7.8444], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854]\n",
      "=====> init acc: (tensor(0.3000, device='cuda:1'), 0.5, 0.65)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 9.0586e-03,  5.2653e-03, -7.5955e-02,  2.5767e-02,  3.1580e-02,\n",
      "         5.0034e-05, -6.6166e-02,  7.2426e-04,  1.5621e-01,  1.3365e-03,\n",
      "         3.0392e-02,  8.3327e-03,  1.7244e-03,  1.0084e-02,  3.2135e-03,\n",
      "         6.8194e-04,  4.9864e-03,  6.4523e-02,  1.7359e-02,  4.0756e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.00119909/1.0000000\n",
      "grad_weights: tensor([ 8.4697e-03,  4.5054e-03, -5.7119e-02,  2.1981e-02,  2.7041e-02,\n",
      "         3.0407e-05, -4.3913e-02,  6.8696e-04,  1.3993e-01,  1.0304e-03,\n",
      "         2.6883e-02,  7.3229e-03,  1.3315e-03,  7.8657e-03,  2.8415e-03,\n",
      "         6.0738e-04,  4.4293e-03,  5.8392e-02,  1.4503e-02,  3.3881e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.00115741/1.0000000\n",
      "grad_weights: tensor([ 7.2235e-03,  3.5509e-03, -4.0443e-02,  1.7495e-02,  2.2440e-02,\n",
      "         9.8887e-06, -2.7454e-02,  6.0394e-04,  1.1707e-01,  7.3287e-04,\n",
      "         2.2109e-02,  5.9293e-03,  9.0035e-04,  5.5270e-03,  2.3410e-03,\n",
      "         4.6624e-04,  3.6960e-03,  4.8738e-02,  1.1235e-02,  2.5754e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.00112852/1.0000000\n",
      "grad_weights: tensor([ 5.1547e-03,  2.4030e-03, -2.6128e-02,  1.2286e-02,  1.7563e-02,\n",
      "        -1.1362e-05, -1.5748e-02,  4.6147e-04,  8.8577e-02,  4.4348e-04,\n",
      "         1.6251e-02,  4.1535e-03,  4.3814e-04,  3.1055e-03,  1.6977e-03,\n",
      "         2.3915e-04,  2.7812e-03,  3.5672e-02,  7.5495e-03,  1.6290e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.00111167/1.0000000\n",
      "grad_weights: tensor([ 1.9269e-03,  1.0143e-03, -1.3603e-02,  6.1928e-03,  1.2449e-02,\n",
      "        -3.3654e-05, -7.4686e-03,  2.3663e-04,  5.5344e-02,  1.5988e-04,\n",
      "         9.2035e-03,  1.8504e-03, -6.9120e-05,  5.4601e-04,  8.6597e-04,\n",
      "        -1.1187e-04,  1.6131e-03,  1.8573e-02,  3.3574e-03,  5.1825e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.00110571/1.0000000\n",
      "grad_weights: tensor([-2.5948e-03, -6.9261e-04, -2.8332e-03, -7.7737e-04,  7.2008e-03,\n",
      "        -5.6618e-05, -1.8082e-03, -8.4990e-05,  1.8362e-02, -1.1166e-04,\n",
      "         7.2909e-04, -9.7609e-04, -6.1006e-04, -2.1168e-03, -1.4585e-04,\n",
      "        -6.0342e-04,  2.1015e-04, -1.9238e-03, -1.2298e-03, -7.5003e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.00110828/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.2767, device='cuda:1'), 0.8, 0.5)\n",
      "=====> Optimized weights: tensor([-6.5634, -6.5265,  6.4448, -6.6137, -6.8309, -3.8392,  6.1902, -6.7193,\n",
      "        -6.7896, -6.3430, -6.7121, -6.5871, -5.9879, -6.2160, -6.6624, -5.8221,\n",
      "        -6.7416, -6.6977, -6.5314, -6.3859], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663]\n",
      "=====> init acc: (tensor(0.8000, device='cuda:1'), 1.0, 0.9)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0031,  0.0004,  0.0115,  0.0129,  0.0075,  0.0021,  0.0030, -0.0171,\n",
      "         0.0015,  0.0028,  0.0055,  0.0250,  0.0044,  0.0146,  0.0002,  0.0039,\n",
      "         0.0203, -0.0047,  0.0010, -0.0426], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00121511/1.0000000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "grad_weights: tensor([ 0.0027,  0.0004,  0.0101,  0.0111,  0.0070,  0.0019,  0.0030, -0.0135,\n",
      "         0.0013,  0.0025,  0.0047,  0.0232,  0.0037,  0.0132,  0.0002,  0.0035,\n",
      "         0.0188, -0.0036,  0.0009, -0.0347], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00118288/1.0000000\n",
      "grad_weights: tensor([ 0.0024,  0.0003,  0.0086,  0.0092,  0.0064,  0.0016,  0.0029, -0.0103,\n",
      "         0.0010,  0.0021,  0.0039,  0.0208,  0.0030,  0.0116,  0.0001,  0.0031,\n",
      "         0.0170, -0.0027,  0.0007, -0.0277], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00115734/1.0000000\n",
      "grad_weights: tensor([ 0.0020,  0.0002,  0.0070,  0.0070,  0.0055,  0.0013,  0.0027, -0.0076,\n",
      "         0.0007,  0.0016,  0.0030,  0.0180,  0.0023,  0.0100,  0.0001,  0.0026,\n",
      "         0.0148, -0.0020,  0.0005, -0.0213], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00113825/1.0000000\n",
      "grad_weights: tensor([ 1.6043e-03,  1.6717e-04,  5.4645e-03,  4.6579e-03,  4.4689e-03,\n",
      "         1.0136e-03,  2.3454e-03, -5.3554e-03,  4.1296e-04,  1.0692e-03,\n",
      "         2.1455e-03,  1.4636e-02,  1.4859e-03,  8.2161e-03,  6.0056e-05,\n",
      "         2.1212e-03,  1.2285e-02, -1.3751e-03,  3.5738e-04, -1.5664e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00112524/1.0000000\n",
      "grad_weights: tensor([ 1.2138e-03,  7.6178e-05,  3.8425e-03,  2.1751e-03,  3.1936e-03,\n",
      "         6.4948e-04,  1.8039e-03, -3.4434e-03,  1.0362e-04,  4.1070e-04,\n",
      "         1.2050e-03,  1.0786e-02,  6.2698e-04,  6.4139e-03,  1.7986e-05,\n",
      "         1.5488e-03,  9.3809e-03, -8.8340e-04,  1.6102e-04, -1.0759e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00111784/1.0000000\n",
      "grad_weights: tensor([ 8.7730e-04, -2.5470e-05,  2.1970e-03, -4.6866e-04,  1.6787e-03,\n",
      "         2.4552e-04,  1.0412e-03, -1.8324e-03, -2.1321e-04, -3.5282e-04,\n",
      "         2.2342e-04,  6.4090e-03, -2.8049e-04,  4.5157e-03, -2.4475e-05,\n",
      "         9.1970e-04,  6.0917e-03, -4.8223e-04, -4.7518e-05, -6.3365e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00111527/1.0000000\n",
      "grad_weights: tensor([ 4.9538e-04, -1.3442e-04,  5.7032e-04, -3.2044e-03, -2.6100e-05,\n",
      "        -1.8396e-04,  6.4975e-05, -5.0196e-04, -5.2967e-04, -1.1992e-03,\n",
      "        -7.6637e-04,  1.6537e-03, -1.2103e-03,  2.5832e-03, -6.6419e-05,\n",
      "         2.4895e-04,  2.5198e-03, -1.6124e-04, -2.5946e-04, -2.4834e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00111640/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6972, device='cuda:1'), 0.9, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-17.1480, -15.8617, -16.8507, -15.8886, -17.1455, -16.6699, -17.5461,\n",
      "         16.0746, -15.1431, -15.6895, -16.2272, -17.2112, -15.7249, -17.2907,\n",
      "        -15.2165, -17.0950, -17.3289,  15.9670, -15.7782,  16.4230],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663, 143, 303, 951, 621]\n",
      "reset tmp model\n",
      "=====> init acc: (tensor(0.3000, device='cuda:1'), 0.8, 0.65)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 6.5130e-03,  4.6998e-05,  3.6128e-04, -2.0788e-03,  5.3213e-04,\n",
      "         3.4370e-04,  1.5589e-02,  4.0773e-05,  1.3401e-02,  1.4618e-03,\n",
      "         3.7423e-03,  4.5844e-02,  1.5108e-05,  1.1274e-02,  4.7603e-03,\n",
      "         2.4974e-04, -5.3040e-02,  3.9884e-03,  1.8920e-02,  6.4945e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.00120864/1.0000000\n",
      "grad_weights: tensor([ 6.4076e-03,  3.6976e-05,  3.2022e-04, -1.7061e-03,  4.3109e-04,\n",
      "         2.8955e-04,  1.3934e-02,  3.0727e-05,  1.1795e-02,  1.2793e-03,\n",
      "         3.1475e-03,  5.2354e-02,  1.2072e-05,  9.5078e-03,  4.0993e-03,\n",
      "         2.2156e-04, -3.8906e-02,  3.6616e-03,  1.6920e-02,  5.6037e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.00117329/1.0000000\n",
      "grad_weights: tensor([ 5.3855e-03,  2.5278e-05,  2.6392e-04, -1.3739e-03,  3.1170e-04,\n",
      "         2.3529e-04,  1.1784e-02,  1.9734e-05,  9.7514e-03,  1.0249e-03,\n",
      "         2.5082e-03,  5.5156e-02,  8.7409e-06,  7.5987e-03,  3.3228e-03,\n",
      "         1.8227e-04, -2.7350e-02,  3.1873e-03,  1.4274e-02,  4.6881e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.00114776/1.0000000\n",
      "grad_weights: tensor([ 4.0592e-03,  1.2089e-05,  1.9028e-04, -1.0784e-03,  1.7387e-04,\n",
      "         1.7730e-04,  9.1661e-03,  7.6679e-06,  7.2151e-03,  6.9488e-04,\n",
      "         1.8283e-03,  5.1886e-02,  5.0776e-06,  5.6554e-03,  2.4542e-03,\n",
      "         1.3007e-04, -1.8093e-02,  2.5335e-03,  1.0980e-02,  3.7351e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.00113174/1.0000000\n",
      "grad_weights: tensor([ 2.3515e-03, -3.5192e-06,  9.2733e-05, -8.1606e-04,  1.0619e-05,\n",
      "         1.1651e-04,  5.9527e-03, -5.6434e-06,  4.0687e-03,  2.5715e-04,\n",
      "         1.0964e-03,  3.7223e-02,  1.0138e-06,  3.3837e-03,  1.4158e-03,\n",
      "         6.0196e-05, -1.0682e-02,  1.6441e-03,  6.9024e-03,  2.7392e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.00112471/1.0000000\n",
      "grad_weights: tensor([ 2.1247e-04, -2.1272e-05, -3.0169e-05, -5.8317e-04, -1.7654e-04,\n",
      "         5.4077e-05,  2.1054e-03, -2.0073e-05,  2.8308e-04, -2.9337e-04,\n",
      "         3.1147e-04,  1.0025e-02, -3.4222e-06,  9.4387e-04,  2.1958e-04,\n",
      "        -2.8150e-05, -4.9127e-03,  5.0566e-04,  1.9440e-03,  1.7015e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.00112544/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4962, device='cuda:1'), 0.7, 0.0)\n",
      "=====> Optimized weights: tensor([-15.1160, -12.8448, -14.7402,  15.1674, -13.7034, -14.9962, -15.1800,\n",
      "        -12.3485, -14.9477, -14.4754, -14.8945, -15.7158, -12.8524, -14.9243,\n",
      "        -14.9185, -14.6647,  14.4026, -15.2517, -15.1317, -15.2774],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663, 143, 303, 951, 621, 136, 779, 568, 694]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 3.0366e-03,  3.2716e-04, -2.1681e-01,  7.9779e-03,  8.1139e-05,\n",
      "         1.9358e-02,  1.1524e-02,  1.2865e-03,  3.1347e-04,  6.0994e-03,\n",
      "         5.5722e-03,  6.3233e-03,  4.2025e-03,  8.9212e-04,  8.0668e-03,\n",
      "         1.2428e-02, -5.9332e-02,  3.0374e-04,  1.2191e-02,  4.2931e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00119375/1.0000000\n",
      "grad_weights: tensor([ 2.5362e-03,  2.6176e-04, -1.3469e-01,  6.0355e-03,  4.2559e-05,\n",
      "         1.6245e-02,  1.0845e-02,  1.0984e-03,  2.2997e-04,  4.8948e-03,\n",
      "         4.4406e-03,  4.9877e-03,  3.2697e-03,  7.8682e-04,  7.4916e-03,\n",
      "         1.1339e-02, -4.2849e-02,  1.4514e-04,  1.0226e-02,  3.9534e-02],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 820 | 993 ####, loss/acc = 0.00115056/1.0000000\n",
      "grad_weights: tensor([ 1.9719e-03,  1.8505e-04, -7.5254e-02,  4.0068e-03,  2.2824e-06,\n",
      "         1.2633e-02,  9.1843e-03,  8.3704e-04,  1.3492e-04,  3.5541e-03,\n",
      "         3.2031e-03,  3.5830e-03,  2.2573e-03,  6.0023e-04,  6.3412e-03,\n",
      "         9.3703e-03, -2.8099e-02, -1.2669e-05,  8.2542e-03,  3.3563e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00112329/1.0000000\n",
      "grad_weights: tensor([ 1.3419e-03,  9.5799e-05, -3.6465e-02,  1.9456e-03, -3.9358e-05,\n",
      "         8.6251e-03,  6.2554e-03,  4.9688e-04,  2.8930e-05,  2.0569e-03,\n",
      "         1.8666e-03,  2.1402e-03,  1.1926e-03,  3.1328e-04,  4.4471e-03,\n",
      "         6.3266e-03, -1.6727e-02, -1.6881e-04,  6.2000e-03,  2.3412e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00111005/1.0000000\n",
      "grad_weights: tensor([ 6.4784e-04, -7.7293e-06, -1.2570e-02, -2.0407e-04, -8.2412e-05,\n",
      "         4.2489e-03,  1.7406e-03,  7.2344e-05, -8.8819e-05,  3.9032e-04,\n",
      "         4.2529e-04,  6.3921e-04,  3.3280e-05, -1.0051e-04,  1.6602e-03,\n",
      "         2.0597e-03, -7.8879e-03, -3.2324e-04,  4.0501e-03,  1.0278e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00110816/1.0000000\n",
      "grad_weights: tensor([-8.9916e-05, -1.1879e-04,  1.1082e-03, -2.3320e-03, -1.2190e-04,\n",
      "        -5.3485e-04, -4.3356e-03, -4.3215e-04, -2.1365e-04, -1.3817e-03,\n",
      "        -1.0724e-03, -8.6914e-04, -1.1545e-03, -6.3673e-04, -1.9987e-03,\n",
      "        -3.3251e-03, -1.1746e-03, -4.7188e-04,  1.8796e-03, -6.1505e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00111391/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3696, device='cuda:1'), 0.8, 1.0)\n",
      "=====> Optimized weights: tensor([-8.9681, -8.2646,  8.1488, -8.2088, -3.9262, -8.9822, -8.8427, -8.5706,\n",
      "        -7.2302, -8.5557, -8.5826, -8.6421, -8.3526, -8.1120, -8.9693, -8.8844,\n",
      "         8.6173, -3.5577, -9.2191, -9.0534], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663, 143, 303, 951, 621, 136, 779, 568, 694, 537, 421, 110, 497]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.7, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([-2.1365e-02,  3.6075e-04,  4.1445e-04, -3.7901e-02,  8.6751e-04,\n",
      "         7.1168e-02,  1.4277e-04,  2.2667e-04,  3.1892e-03,  2.3654e-03,\n",
      "         8.1053e-04,  9.2867e-05,  3.8165e-04,  1.8205e-03,  1.4740e-02,\n",
      "         1.7715e-02, -1.9927e-03,  5.2644e-03,  1.3117e-03,  8.9815e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.00116882/1.0000000\n",
      "grad_weights: tensor([-1.2774e-02,  2.4595e-04,  2.5641e-04, -2.3403e-02,  6.4697e-04,\n",
      "         4.7475e-02,  6.6802e-05,  1.2640e-04,  2.2917e-03,  1.6976e-03,\n",
      "         4.6935e-04,  6.2768e-05,  2.5179e-04,  1.1750e-03,  1.1265e-02,\n",
      "         1.2895e-02, -1.3674e-03,  3.2870e-03,  9.2268e-04,  5.9589e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.00112252/1.0000000\n",
      "grad_weights: tensor([-6.1420e-03,  8.9762e-05,  7.6209e-05, -1.2437e-02,  2.7679e-04,\n",
      "         2.0725e-02, -1.3759e-05, -1.1966e-06,  1.0363e-03,  4.4569e-04,\n",
      "         8.9551e-05,  2.0359e-05,  9.4569e-05,  3.2086e-04,  4.7675e-03,\n",
      "         7.6086e-03, -8.5187e-04,  1.2087e-03,  3.8400e-04,  2.5607e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.00111104/1.0000000\n",
      "grad_weights: tensor([-1.1123e-03, -1.1542e-04, -1.2192e-04, -4.3101e-03, -2.8388e-04,\n",
      "        -8.5080e-03, -9.1496e-05, -1.5158e-04, -5.6067e-04, -1.6678e-03,\n",
      "        -3.2331e-04, -3.6704e-05, -9.0656e-05, -7.6238e-04, -5.6005e-03,\n",
      "         1.6708e-03, -4.3172e-04, -9.5121e-04, -3.0869e-04, -1.2252e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.00112207/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.2787, device='cuda:1'), 0.7, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([ 19.5907, -18.4944, -18.1651,  19.9194, -18.8811, -19.2861, -14.9725,\n",
      "        -15.8417, -19.3220, -17.2256, -17.4008, -17.9547, -18.6987, -17.8521,\n",
      "        -18.7920, -20.3356,  20.5165, -18.7761, -19.0020, -19.2064],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663, 143, 303, 951, 621, 136, 779, 568, 694, 537, 421, 110, 497, 76, 47, 243, 913]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.8, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0014,  0.0003,  0.0251,  0.0188,  0.0095,  0.0001, -0.0270,  0.0042,\n",
      "         0.0217,  0.0118, -0.0067,  0.0013,  0.0090,  0.0600,  0.0058,  0.0012,\n",
      "         0.0911,  0.0018,  0.0107,  0.1013], device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.00121271/1.0000000\n",
      "grad_weights: tensor([ 0.0010,  0.0002,  0.0226,  0.0159,  0.0086,  0.0001, -0.0178,  0.0036,\n",
      "         0.0198,  0.0111, -0.0054,  0.0011,  0.0088,  0.0528,  0.0051,  0.0011,\n",
      "         0.0835,  0.0017,  0.0093,  0.0934], device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.00117954/1.0000000\n",
      "grad_weights: tensor([ 6.9145e-04,  2.1076e-04,  1.9561e-02,  1.2706e-02,  7.4422e-03,\n",
      "         8.3319e-05, -1.1331e-02,  3.0063e-03,  1.7079e-02,  1.0056e-02,\n",
      "        -4.1890e-03,  7.8701e-04,  8.1470e-03,  4.4219e-02,  4.3061e-03,\n",
      "         9.3794e-04,  7.3041e-02,  1.4097e-03,  7.7211e-03,  8.4783e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.00115447/1.0000000\n",
      "grad_weights: tensor([ 3.4258e-04,  1.6908e-04,  1.5811e-02,  9.0947e-03,  5.9943e-03,\n",
      "         6.0337e-05, -6.9207e-03,  2.3264e-03,  1.3907e-02,  8.5277e-03,\n",
      "        -3.1604e-03,  5.0213e-04,  7.2054e-03,  3.4798e-02,  3.3130e-03,\n",
      "         7.3835e-04,  6.0066e-02,  1.0866e-03,  5.9889e-03,  7.0575e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.00113721/1.0000000\n",
      "grad_weights: tensor([-7.6192e-06,  1.2424e-04,  1.1384e-02,  5.1047e-03,  4.2862e-03,\n",
      "         3.7464e-05, -3.9495e-03,  1.6041e-03,  9.5523e-03,  6.4820e-03,\n",
      "        -2.1772e-03,  2.0653e-04,  5.9651e-03,  2.4393e-02,  2.1251e-03,\n",
      "         5.1330e-04,  4.4662e-02,  7.2535e-04,  4.0963e-03,  5.3360e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.00112743/1.0000000\n",
      "grad_weights: tensor([-3.7106e-04,  7.5451e-05,  6.1460e-03,  7.1613e-04,  2.2648e-03,\n",
      "         1.2579e-05, -1.9749e-03,  8.1119e-04,  4.1678e-03,  3.8153e-03,\n",
      "        -1.2976e-03, -1.0884e-04,  3.4198e-03,  1.2837e-02,  6.8980e-04,\n",
      "         2.5039e-04,  2.6622e-02,  2.0118e-04,  2.3447e-03,  3.2914e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.00112451/1.0000000\n",
      "grad_weights: tensor([-7.4100e-04,  2.3139e-05,  1.8322e-04, -4.0840e-03, -4.2888e-05,\n",
      "        -1.0368e-05, -6.8954e-04, -4.1673e-05, -2.1555e-03,  5.1658e-04,\n",
      "        -4.7175e-04, -4.4041e-04, -9.6862e-05,  4.3290e-04, -9.6466e-04,\n",
      "        -4.4309e-05,  6.5695e-03, -4.3583e-04,  4.8379e-05,  9.9931e-03],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 860 | 993 ####, loss/acc = 0.00112697/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.8979, device='cuda:1'), 0.8, 0.0)\n",
      "=====> Optimized weights: tensor([-5.8618, -7.2116, -7.2329, -6.8297, -7.2220, -6.8602,  6.4829, -7.1233,\n",
      "        -7.1685, -7.3500,  7.0504, -6.4866, -7.4128, -7.1679, -7.0304, -7.1496,\n",
      "        -7.3030, -7.0227, -7.1463, -7.3544], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663, 143, 303, 951, 621, 136, 779, 568, 694, 537, 421, 110, 497, 76, 47, 243, 913, 146, 898, 587, 233]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.7, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 2.8924e-03,  2.7351e-03,  3.1780e-04,  6.7309e-02, -1.3375e-02,\n",
      "         1.3431e-02,  9.7293e-03,  8.5367e-04,  7.2947e-04,  7.8827e-03,\n",
      "         2.3199e-03,  1.0087e-03,  7.8327e-04,  4.0001e-03,  4.2914e-03,\n",
      "         2.3523e-02, -5.6543e-02,  4.2443e-04,  2.3595e-03,  8.0244e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.00118660/1.0000000\n",
      "grad_weights: tensor([ 2.5766e-03,  2.3398e-03,  2.6190e-04,  6.0040e-02, -1.0200e-02,\n",
      "         1.0076e-02,  8.1839e-03,  7.0552e-04,  6.4866e-04,  6.3540e-03,\n",
      "         1.6915e-03,  6.6841e-04,  6.3210e-04,  3.4378e-03,  3.1298e-03,\n",
      "         1.8543e-02, -3.7018e-02,  3.7073e-04,  1.8822e-03,  5.1926e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.00114102/1.0000000\n",
      "grad_weights: tensor([ 2.0828e-03,  1.8068e-03,  1.7198e-04,  4.3772e-02, -7.4991e-03,\n",
      "         6.6257e-03,  5.7848e-03,  4.8274e-04,  4.5050e-04,  4.4123e-03,\n",
      "         1.0210e-03,  2.6971e-04,  4.3303e-04,  2.3965e-03,  1.8064e-03,\n",
      "         1.3082e-02, -2.2153e-02,  2.8808e-04,  1.2918e-03,  2.0883e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.00111622/1.0000000\n",
      "grad_weights: tensor([ 1.3038e-03,  1.0948e-03,  4.1046e-05,  1.8133e-02, -5.1984e-03,\n",
      "         3.0546e-03,  2.3741e-03,  1.6605e-04,  8.0470e-05,  2.1387e-03,\n",
      "         3.1026e-04, -1.5580e-04,  1.8354e-04,  7.5774e-04,  3.2687e-04,\n",
      "         7.0749e-03, -1.1119e-02,  1.6992e-04,  6.2935e-04, -1.2519e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.00110995/1.0000000\n",
      "grad_weights: tensor([ 2.2580e-04,  1.9076e-04, -1.4053e-04, -1.6499e-02, -3.2558e-03,\n",
      "        -5.0939e-04, -2.2110e-03, -2.5895e-04, -5.2012e-04, -4.6170e-04,\n",
      "        -4.3109e-04, -6.0208e-04, -1.2398e-04, -1.6446e-03, -1.3254e-03,\n",
      "         6.8432e-04, -3.0873e-03,  9.7297e-06, -8.2035e-05, -4.8210e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.00111611/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4841, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-17.2758, -17.1394, -15.5876, -16.4716,  17.1842, -16.4143, -16.3604,\n",
      "        -16.0576, -15.2975, -16.6119, -15.8177, -13.5896, -16.3496, -15.9520,\n",
      "        -15.4048, -16.7830,  16.1839, -17.0603, -16.6096, -13.3215],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663, 143, 303, 951, 621, 136, 779, 568, 694, 537, 421, 110, 497, 76, 47, 243, 913, 146, 898, 587, 233, 246, 797, 821, 631]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.7, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 9.2196e-04,  3.7472e-03,  5.5641e-04,  1.1616e-03, -2.3461e-02,\n",
      "         1.2142e-01,  3.9783e-04,  2.1572e-05,  2.7459e-02,  1.8269e-04,\n",
      "        -2.1885e-02,  5.4197e-04,  3.4594e-03,  7.6875e-03,  3.7494e-02,\n",
      "         1.0855e-03,  2.2831e-02, -8.5825e-03, -3.7818e-02,  9.3613e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.00117554/1.0000000\n",
      "grad_weights: tensor([ 4.8797e-04,  3.1669e-03,  3.9214e-04,  7.4433e-04, -1.4741e-02,\n",
      "         9.3279e-02,  1.7759e-04,  1.2756e-05,  1.9773e-02,  7.5695e-05,\n",
      "        -1.4455e-02,  3.4261e-04,  2.9722e-03,  7.5413e-03,  2.9458e-02,\n",
      "         8.7376e-04,  1.7779e-02, -6.1322e-03, -2.5312e-02,  5.3973e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.00112563/1.0000000\n",
      "grad_weights: tensor([ 2.5166e-05,  2.0319e-03,  2.2128e-04,  3.0489e-04, -7.5202e-03,\n",
      "         6.2473e-02, -5.4712e-05,  2.9702e-06,  1.1575e-02, -3.3965e-05,\n",
      "        -8.3957e-03,  1.1086e-04,  2.1179e-03,  5.9833e-03,  1.8579e-02,\n",
      "         5.5583e-04,  1.1813e-02, -3.9636e-03, -1.4640e-02,  5.9799e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.00110208/1.0000000\n",
      "grad_weights: tensor([-4.7881e-04,  5.8204e-05,  3.1568e-05, -1.6526e-04, -1.5121e-03,\n",
      "         2.9356e-02, -3.0059e-04, -8.0497e-06,  2.7731e-03, -1.4778e-04,\n",
      "        -3.4326e-03, -1.6131e-04,  6.7046e-04,  1.9662e-03,  4.6991e-03,\n",
      "         8.5110e-05,  4.8019e-03, -2.0469e-03, -5.5483e-03, -5.2816e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.00110077/1.0000000\n",
      "grad_weights: tensor([-1.0026e-03, -2.8540e-03, -1.6248e-04, -6.4206e-04,  3.3495e-03,\n",
      "        -4.6101e-03, -5.4570e-04, -1.9625e-05, -6.3023e-03, -2.6005e-04,\n",
      "         5.2722e-04, -4.6025e-04, -1.3911e-03, -5.3307e-03, -1.1527e-02,\n",
      "        -5.3913e-04, -2.9952e-03, -3.8772e-04,  2.1225e-03, -1.2010e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.00111244/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4250, device='cuda:1'), 0.9, 0.75)\n",
      "=====> Optimized weights: tensor([ -8.1697, -11.7306, -12.0670, -10.7888,  12.0698, -13.0409,  -6.6065,\n",
      "         -8.7406, -12.3420,  -6.1718,  12.6098,  -9.7992, -12.6466, -12.5731,\n",
      "        -12.4578, -12.1263, -12.8805,  13.0252,  12.5633,  -8.1845],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663, 143, 303, 951, 621, 136, 779, 568, 694, 537, 421, 110, 497, 76, 47, 243, 913, 146, 898, 587, 233, 246, 797, 821, 631, 935, 1036, 336, 922]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(0.9000, device='cuda:1'), 0.9, 0.95)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 3.3788e-04,  1.2701e-02,  1.9905e-03,  1.9258e-03, -1.5789e-02,\n",
      "         1.9608e-03,  3.9727e-03,  6.8062e-03,  5.6330e-03,  3.5067e-04,\n",
      "         2.2895e-03,  8.3089e-03,  1.9857e-04,  1.4337e-01,  2.4285e-03,\n",
      "         2.3177e-04,  4.7157e-03,  7.0278e-04,  6.9911e-02,  1.4245e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.00115925/1.0000000\n",
      "grad_weights: tensor([ 7.3034e-05,  8.4375e-03,  1.4736e-03,  1.1128e-03, -6.3430e-03,\n",
      "         1.3215e-03,  2.0901e-03,  4.4783e-03,  3.9835e-03,  1.7124e-04,\n",
      "         1.6462e-03,  6.2624e-03,  9.1089e-05,  1.0485e-01,  1.4773e-03,\n",
      "         1.1801e-04,  3.1443e-03,  4.3947e-04,  4.8481e-02,  9.3853e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.00112124/1.0000000\n",
      "grad_weights: tensor([-2.2040e-04,  2.5811e-03,  9.6792e-05, -6.7228e-05,  1.1931e-03,\n",
      "         3.6612e-04, -8.3030e-05,  1.1471e-03,  8.6907e-04, -2.8484e-05,\n",
      "        -5.4326e-05,  3.3146e-04, -2.7479e-05,  3.6239e-02,  2.5908e-04,\n",
      "        -2.3061e-05,  5.8446e-04,  1.3233e-04,  6.9211e-03,  1.2580e-05],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.00113237/1.0000000\n",
      "=====> Optimized acc: (tensor(-1., device='cuda:1'), 0.9, 0.0)\n",
      "=====> Optimized weights: tensor([ -8.6951, -12.2980, -12.0669, -11.6511,  11.1279, -12.2730, -11.5879,\n",
      "        -12.2257, -12.2527, -11.3081, -11.8848, -12.0660, -11.0456, -12.4496,\n",
      "        -12.0305, -11.2883, -12.1485, -12.2019, -12.1314, -11.9682],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663, 143, 303, 951, 621, 136, 779, 568, 694, 537, 421, 110, 497, 76, 47, 243, 913, 146, 898, 587, 233, 246, 797, 821, 631, 935, 1036, 336, 922, 946, 218, 521, 1000]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0004,  0.0089, -0.0049,  0.0083,  0.0234,  0.0090,  0.0012,  0.0163,\n",
      "        -0.0817, -0.0496,  0.0005,  0.1113,  0.0017,  0.0018,  0.0002,  0.0018,\n",
      "         0.0330,  0.0631,  0.0044,  0.0043], device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.00118045/1.0000000\n",
      "grad_weights: tensor([ 0.0003,  0.0076, -0.0030,  0.0065,  0.0181,  0.0069,  0.0009,  0.0164,\n",
      "        -0.0495, -0.0311,  0.0004,  0.0978,  0.0011,  0.0012,  0.0001,  0.0019,\n",
      "         0.0287,  0.0495,  0.0037,  0.0035], device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.00113326/1.0000000\n",
      "grad_weights: tensor([ 1.6125e-04,  5.3763e-03, -1.6464e-03,  4.1099e-03,  1.2505e-02,\n",
      "         3.9240e-03,  4.6161e-04,  1.3268e-02, -2.6091e-02, -1.7334e-02,\n",
      "         2.7990e-04,  6.7843e-02,  5.3768e-04,  4.8746e-04, -1.9405e-05,\n",
      "         1.4363e-03,  2.0059e-02,  3.2744e-02,  2.5188e-03,  2.3258e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.00111122/1.0000000\n",
      "grad_weights: tensor([-1.6323e-05,  2.0017e-03, -7.2616e-04,  1.0514e-03,  6.5523e-03,\n",
      "        -1.5065e-04, -2.5616e-05,  4.2414e-03, -9.4981e-03, -7.3448e-03,\n",
      "         9.3152e-05,  2.4713e-02, -9.9881e-05, -3.0198e-04, -1.6274e-04,\n",
      "        -5.6235e-05,  5.8314e-03,  1.2028e-02,  8.1859e-04,  5.9453e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.00111098/1.0000000\n",
      "grad_weights: tensor([-2.3424e-04, -2.6489e-03, -6.3022e-05, -2.6227e-03,  4.0006e-04,\n",
      "        -5.5883e-03, -5.7659e-04, -1.2635e-02,  1.6052e-03, -2.7776e-04,\n",
      "        -1.4666e-04, -2.7995e-02, -7.5892e-04, -1.1589e-03, -3.1485e-04,\n",
      "        -3.1851e-03, -1.4035e-02, -1.1251e-02, -1.4875e-03, -1.6430e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.00112295/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5806, device='cuda:1'), 0.9, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-8.0992, -9.0612,  8.8180, -8.7899, -9.3206, -8.1951, -8.2125, -8.8426,\n",
      "         8.7097,  8.8456, -8.9445, -9.1090, -8.0160, -7.5263, -4.9352, -7.8433,\n",
      "        -8.8927, -9.0359, -8.9458, -8.7995], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663, 143, 303, 951, 621, 136, 779, 568, 694, 537, 421, 110, 497, 76, 47, 243, 913, 146, 898, 587, 233, 246, 797, 821, 631, 935, 1036, 336, 922, 946, 218, 521, 1000, 208, 828, 893, 83]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.8, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 6.8365e-03,  5.8249e-03,  3.5751e-04,  5.0353e-02,  2.2989e-02,\n",
      "         1.2323e-02,  4.1245e-01,  7.8493e-03,  1.8179e-02,  1.8491e-03,\n",
      "         6.2968e-03,  3.4772e-03,  1.1670e-04, -7.5332e-02,  8.1330e-03,\n",
      "         3.3982e-02,  3.6463e-03,  5.2683e-02,  3.5447e-04, -1.8129e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.00116812/1.0000000\n",
      "grad_weights: tensor([ 4.5410e-03,  4.0186e-03,  1.6358e-04,  3.9112e-02,  2.3184e-02,\n",
      "         8.6443e-03,  2.8874e-01,  4.9993e-03,  1.3024e-02,  1.4733e-03,\n",
      "         4.0612e-03,  2.3852e-03,  8.4258e-05, -4.2974e-02,  5.7325e-03,\n",
      "         2.4553e-02,  2.3392e-03,  3.5136e-02,  2.6694e-04, -1.2048e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.00112161/1.0000000\n",
      "grad_weights: tensor([ 2.0529e-03,  1.6661e-03, -4.5570e-05,  2.1613e-02,  1.5521e-02,\n",
      "         3.9499e-03,  1.4031e-01,  1.3628e-03,  7.1585e-03,  7.3201e-04,\n",
      "         1.4723e-03,  8.0774e-04,  2.9644e-05, -1.7948e-02,  2.7723e-03,\n",
      "         1.3794e-02,  5.8668e-04,  1.4727e-02,  9.6430e-05, -7.1578e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.00111131/1.0000000\n",
      "grad_weights: tensor([-6.5912e-04, -1.3685e-03, -2.7426e-04, -3.1038e-03, -6.2835e-03,\n",
      "        -1.8578e-03, -8.0198e-04, -3.2824e-03,  3.1024e-04, -5.6081e-04,\n",
      "        -1.5198e-03, -1.2807e-03, -5.5192e-05,  1.2553e-03, -8.7632e-04,\n",
      "         1.8967e-03, -1.7375e-03, -8.7687e-03, -2.0220e-04, -3.2175e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.00112692/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5179, device='cuda:1'), 0.8, 1.0)\n",
      "=====> Optimized weights: tensor([-5.1593, -5.0511, -3.8555, -5.3301, -5.3506, -5.1547, -5.2785, -4.7477,\n",
      "        -5.3389, -5.1329, -4.9681, -4.8854, -4.7942,  5.1011, -5.2056, -5.3743,\n",
      "        -4.6864, -5.0882, -4.7841,  5.4121], device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663, 143, 303, 951, 621, 136, 779, 568, 694, 537, 421, 110, 497, 76, 47, 243, 913, 146, 898, 587, 233, 246, 797, 821, 631, 935, 1036, 336, 922, 946, 218, 521, 1000, 208, 828, 893, 83, 48, 291, 444, 265]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(-0.3901, device='cuda:1'), 0.4, 0.0)\n",
      "=====> init weights: tensor([  0.0000,   0.0000,   0.0000,   0.0000,   0.0000,   0.0000,   0.0000,\n",
      "          0.0000,   0.0000,   0.0000,   0.0000,   0.0000,   0.0000, -11.9524,\n",
      "         12.3002,  -9.0694, -12.2020, -12.7148, -11.1090, -12.3555],\n",
      "       device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.00114354/1.0000000\n",
      "grad_weights: tensor([ 4.8951e-02,  8.4184e-03,  6.4072e-03,  7.5227e-03,  9.5957e-03,\n",
      "         3.2676e-04,  1.9260e-02,  1.2282e-02,  5.3863e-03, -1.8922e-02,\n",
      "         6.2729e-05, -3.4790e-02, -3.8418e-03,  1.3627e-02, -7.2498e-03,\n",
      "         1.1737e-04,  1.0770e-02,  5.5982e-02,  1.8762e-04,  2.6103e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.00112046/1.0000000\n",
      "grad_weights: tensor([ 3.3191e-02,  5.5138e-03,  4.1969e-03,  5.2322e-03,  7.2742e-03,\n",
      "         2.3013e-04,  1.3183e-02,  8.3920e-03,  2.7817e-03, -1.0874e-02,\n",
      "         2.0405e-05, -2.1097e-02, -2.2844e-03,  8.1135e-03, -5.1798e-03,\n",
      "        -1.2552e-04,  7.1967e-03,  4.2998e-02,  7.5643e-05,  1.8220e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.00110862/1.0000000\n",
      "grad_weights: tensor([ 1.4873e-02,  2.0609e-03,  1.0060e-03,  2.1097e-03,  4.8676e-03,\n",
      "         1.0567e-04,  5.3529e-03,  3.1676e-03,  1.2009e-04, -4.5186e-03,\n",
      "        -2.6432e-05, -9.0653e-03, -7.9406e-04,  1.3416e-03, -3.2725e-03,\n",
      "        -3.6999e-04,  3.6582e-03,  2.2801e-02, -5.9615e-05,  7.3348e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.00110694/1.0000000\n",
      "grad_weights: tensor([-4.8100e-03, -1.7753e-03, -3.1173e-03, -1.7472e-03,  2.4913e-03,\n",
      "        -4.1183e-05, -3.8004e-03, -3.2010e-03, -2.3328e-03,  6.5076e-04,\n",
      "        -7.4634e-05,  9.7301e-04,  5.7343e-04, -6.2357e-03, -1.5565e-03,\n",
      "        -6.0275e-04, -1.9784e-05, -3.4348e-03, -2.0643e-04, -6.2713e-04],\n",
      "       device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.00111128/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3692, device='cuda:1'), 0.4, 0.25)\n",
      "=====> Optimized weights: tensor([ -4.6973,  -4.5537,  -4.2568,  -4.5902,  -5.0471,  -4.6874,  -4.6087,\n",
      "         -4.5439,  -4.0240,   4.6269,  -2.6703,   4.6711,   4.5253, -16.1231,\n",
      "         17.2889,  -8.4621, -16.9860, -17.5428, -14.0990, -16.9401],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [798, 135, 814, 825, 677, 99, 142, 411, 467, 342, 340, 234, 548, 1040, 961, 930, 770, 851, 496, 816, 618, 150, 485, 733, 119, 602, 636, 392, 43, 356, 749, 307, 123, 750, 334, 154, 793, 993, 982, 350, 478, 93, 689, 191, 970, 406, 320, 941, 209, 117, 834, 403, 645, 479, 138, 491, 92, 445, 709, 134, 428, 551, 80, 254, 707, 728, 883, 483, 273, 641, 426, 869, 949, 713, 658, 183, 820, 262, 199, 591, 906, 789, 972, 248, 440, 539, 613, 383, 339, 324, 112, 1012, 229, 927, 26, 129, 1019, 476, 255, 976, 70, 484, 37, 27, 764, 433, 332, 323, 97, 285, 983, 321, 890, 297, 455, 652, 253, 741, 450, 190, 609, 338, 567, 279, 783, 507, 777, 124, 378, 79, 430, 211, 418, 495, 14, 374, 725, 635, 463, 678, 768, 493, 964, 86, 827, 242, 588, 414, 925, 268, 247, 854, 395, 346, 892, 663, 143, 303, 951, 621, 136, 779, 568, 694, 537, 421, 110, 497, 76, 47, 243, 913, 146, 898, 587, 233, 246, 797, 821, 631, 935, 1036, 336, 922, 946, 218, 521, 1000, 208, 828, 893, 83, 48, 291, 444, 265, 866, 801, 639, 825]\n",
      "reset tmp model\n",
      "%3d | %3d Post-MetaTrain Performance of model1: (0.800575263662512, (array([0.82627579, 0.60655738]), array([0.94066749, 0.31623932]), array([0.87976879, 0.41573034]), array([809, 234])))\n",
      "###Accuracy On selected instancees (0.74, (array([0.97260274, 0.60629921]), array([0.58677686, 0.97468354]), array([0.73195876, 0.74757282]), array([121,  79])))\n",
      "###Accuracy On pseaudo instances (0.98, (array([0.98, 0.  ]), array([1., 0.]), array([0.98989899, 0.        ]), array([49,  1])))\n",
      "###Accuracy On training instances (0.788, (array([0.97560976, 0.60629921]), array([0.70588235, 0.9625    ]), array([0.81911263, 0.74396135]), array([170,  80])))\n",
      "==================Global Data Selection===============>\n",
      "###Accuracy On selected instancees (0.7307692307692307, (array([0.92957746, 0.62773723]), array([0.56410256, 0.94505495]), array([0.70212766, 0.75438596]), array([117,  91])))\n",
      "###Accuracy On pseaudo instances (0.98, (array([0.98, 0.  ]), array([1., 0.]), array([0.98989899, 0.        ]), array([49,  1])))\n",
      "###Accuracy On training instances (0.7790697674418605, (array([0.95041322, 0.62773723]), array([0.69277108, 0.93478261]), array([0.80139373, 0.7510917 ]), array([166,  92])))\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/sklearn/metrics/classification.py:1437: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n"
     ]
    }
   ],
   "source": [
    "v_idxs, pseaudo_idxs = MetaSelfTrain(model1, model2, few_shot_set, unlabeled_set,\n",
    "                                        new_domain_label, pseaudo_idxs, [])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "tr_model, anno_model, f_set, weak_set, weak_set_label, p_idxs, e_idxs = \\\n",
    "        model1, model2, few_shot_set, unlabeled_set, new_domain_label, pseaudo_idxs, []"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.\n",
      "  warnings.warn(warning.format(ret))\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 2.6074e-04,  9.9972e-03,  1.6080e-04,  4.9975e-02,  1.1515e-02,\n",
      "         1.2865e-03,  2.6809e-03,  9.6816e-04,  4.6167e-02,  1.5728e-04,\n",
      "        -7.5955e-02,  1.3147e-03,  4.4440e-05,  5.6791e-04,  3.1960e-03,\n",
      "         4.0359e-02, -7.3729e-02,  6.0040e-02,  1.5793e-02,  1.0386e-03],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.00114175/1.0000000\n",
      "grad_weights: tensor([ 1.3241e-04,  6.1816e-03,  1.1010e-04,  3.3812e-02,  6.1702e-03,\n",
      "         7.6308e-04,  1.8478e-03,  3.4349e-04,  2.7766e-02,  9.0121e-05,\n",
      "        -3.3429e-02,  3.4998e-04,  2.2136e-05,  1.2580e-04,  1.6577e-03,\n",
      "         2.6269e-02, -2.8722e-02,  3.3733e-02,  7.2962e-03,  5.9684e-04],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.00906010/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4978, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-7.1846, -7.3151, -7.3115, -7.3557, -7.2437, -7.2898, -7.3605, -7.0056,\n",
      "        -7.3026, -7.2279,  7.1360, -6.8536, -7.0268, -6.7569, -7.2245, -7.3390,\n",
      "         7.0667, -7.2688, -7.1629, -7.2726], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.5, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.00138407/1.0000000\n",
      "grad_weights: tensor([ 8.5325e-04,  1.5699e-02,  3.2692e-03,  9.8281e-03,  1.6854e-02,\n",
      "         6.6108e-03,  9.2104e-04, -5.5733e-02,  7.8242e-03,  2.1620e-03,\n",
      "        -5.7165e-02,  1.2203e-04,  4.1374e-04,  1.0113e-02,  1.4033e-02,\n",
      "         7.6717e-05,  1.9103e-03,  1.0429e-02,  7.4083e-04, -1.8974e-02],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.00121330/1.0000000\n",
      "grad_weights: tensor([ 1.0695e-03,  1.5691e-02,  3.7025e-03,  1.1769e-02,  1.9689e-02,\n",
      "         8.0682e-03,  1.0792e-03, -6.1586e-02,  9.6750e-03,  2.2187e-03,\n",
      "        -4.4344e-02,  1.8788e-04,  4.4559e-04,  1.3413e-02,  1.5783e-02,\n",
      "         8.5058e-05,  2.1578e-03,  1.1601e-02,  9.6442e-04, -2.4317e-02],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.00180391/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3006, device='cuda:1'), 0.8, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-3.0213, -3.0251, -3.0264, -3.0260, -3.0267, -3.0253, -3.0237,  3.0273,\n",
      "        -3.0249, -3.0248,  3.0035, -2.9870, -3.0201, -3.0214, -3.0272, -2.9895,\n",
      "        -3.0258, -3.0271, -3.0190,  3.0235], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639]\n",
      "=====> init acc: (tensor(0.9000, device='cuda:1'), 1.0, 0.95)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00811181/1.0000000\n",
      "grad_weights: tensor([ 0.0037,  0.2287,  0.1653, -0.1087,  0.0040, -0.2536, -0.0252,  0.0039,\n",
      "         0.6110,  0.1261,  0.0034,  0.0115, -0.1286,  0.0014,  0.0355,  0.3062,\n",
      "         0.0278,  0.0302,  0.0432,  0.0100], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00236163/1.0000000\n",
      "grad_weights: tensor([-0.0003, -0.0110, -0.0048,  0.0074, -0.0014,  0.0112,  0.0001, -0.0005,\n",
      "        -0.0055, -0.0027, -0.0005, -0.0020,  0.0024, -0.0002, -0.0017, -0.0186,\n",
      "        -0.0026, -0.0019, -0.0016, -0.0011], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00122681/1.0000000\n",
      "grad_weights: tensor([ 0.0006,  0.0415,  0.0301, -0.0198,  0.0007, -0.0418, -0.0043,  0.0006,\n",
      "         0.1103,  0.0231,  0.0006,  0.0022, -0.0222,  0.0002,  0.0058,  0.0535,\n",
      "         0.0046,  0.0048,  0.0078,  0.0017], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.00122896/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4833, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-0.7248, -0.7390, -0.7476,  0.7298, -0.5958,  0.7379,  0.7560, -0.6956,\n",
      "        -0.7562, -0.7514, -0.6895, -0.6826,  0.7505, -0.6861, -0.7364, -0.7321,\n",
      "        -0.7154, -0.7277, -0.7435, -0.7072], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893]\n",
      "=====> init acc: (tensor(0.9000, device='cuda:1'), 1.0, 0.95)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0048,  0.0002,  0.0166,  0.0082,  0.0118,  0.0005,  0.0081, -0.0337,\n",
      "         0.0018,  0.0127,  0.0006,  0.0022,  0.0009,  0.0105,  0.0504,  0.0096,\n",
      "         0.0161,  0.0004,  0.0101,  0.0531], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.00317152/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.7999, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-1.2156, -1.2094, -1.2158, -1.2157, -1.2158, -1.2136, -1.2157,  1.2158,\n",
      "        -1.2152, -1.2158, -1.2139, -1.2153, -1.2146, -1.2158, -1.2159, -1.2157,\n",
      "        -1.2158, -1.2131, -1.2158, -1.2159], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.8, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0040,  0.0010,  0.0027,  0.0136,  0.0023,  0.0002,  0.0018,  0.0283,\n",
      "         0.0222,  0.0189,  0.0037,  0.0377,  0.0445, -0.0271,  0.0001,  0.0005,\n",
      "         0.0027,  0.0647,  0.0053,  0.0017], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.00118846/1.0000000\n",
      "grad_weights: tensor([ 2.9337e-03,  6.4860e-04,  1.9294e-03,  1.1112e-02,  1.9845e-03,\n",
      "         1.0785e-04,  1.2321e-03,  2.2795e-02,  1.7347e-02,  1.4849e-02,\n",
      "         3.0870e-03,  3.0614e-02,  3.6073e-02, -1.9909e-02,  8.8626e-05,\n",
      "         4.6544e-04,  2.3810e-03,  5.6935e-02,  4.3344e-03,  1.5397e-03],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.00584992/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6006, device='cuda:1'), 0.7, 1.0)\n",
      "=====> Optimized weights: tensor([-5.2896, -5.2505, -5.2791, -5.3133, -5.3224, -5.2328, -5.2718, -5.3112,\n",
      "        -5.3040, -5.3057, -5.3144, -5.3129, -5.3124,  5.2896, -5.2338, -5.3137,\n",
      "        -5.3246, -5.3271, -5.3145, -5.3261], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138]\n",
      "=====> init acc: (tensor(0.9000, device='cuda:1'), 0.9, 0.95)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.00989858/1.0000000\n",
      "grad_weights: tensor([ 1.3216e-02,  2.9336e-01, -2.4272e-01,  9.4885e-02,  5.2276e-02,\n",
      "         3.2006e-02,  2.8187e-02,  1.4910e-03, -2.8854e-01,  7.4259e-02,\n",
      "         2.6464e-02,  1.0689e-03,  1.7956e-01,  7.4393e-02,  7.7902e-05,\n",
      "         9.7155e-02,  2.7318e-03,  3.6213e-03,  1.6682e-01,  9.4625e-02],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.00124633/1.0000000\n",
      "grad_weights: tensor([ 3.0814e-03,  6.6821e-02, -5.4233e-02,  2.1378e-02,  1.1567e-02,\n",
      "         7.9760e-03,  6.7424e-03,  3.5200e-04, -6.5193e-02,  1.6992e-02,\n",
      "         6.1070e-03,  2.4593e-04,  4.0846e-02,  1.7268e-02,  2.0765e-05,\n",
      "         2.1406e-02,  6.4273e-04,  8.4066e-04,  3.7589e-02,  2.1828e-02],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.00461960/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.9002, device='cuda:1'), 0.9, 0.5)\n",
      "=====> Optimized weights: tensor([-0.3484, -0.3479,  0.3474, -0.3476, -0.3472, -0.3501, -0.3491, -0.3485,\n",
      "         0.3477, -0.3480, -0.3482, -0.3478, -0.3479, -0.3483, -0.3466, -0.3471,\n",
      "        -0.3485, -0.3482, -0.3476, -0.3482], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([-1.0861e-01,  3.3020e-02,  1.6401e-03,  1.3818e-03,  9.1096e-02,\n",
      "         1.1253e-02,  3.6238e-03,  2.5807e-02,  1.7112e-04,  1.5120e-03,\n",
      "        -2.0477e-01,  5.5722e-03,  4.3393e-03,  7.7309e-02,  6.4523e-02,\n",
      "         5.0755e-03, -5.3040e-02,  6.7934e-03,  5.3568e-04,  5.0674e-04],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.00387353/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.7999, device='cuda:1'), 0.8, 0.3333333333333333)\n",
      "=====> Optimized weights: tensor([ 1.7946, -1.7946, -1.7935, -1.7933, -1.7946, -1.7945, -1.7941, -1.7946,\n",
      "        -1.7842, -1.7934,  1.7946, -1.7943, -1.7942, -1.7946, -1.7946, -1.7943,\n",
      "         1.7946, -1.7944, -1.7913, -1.7911], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.9, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.00201392/1.0000000\n",
      "grad_weights: tensor([-3.3233e-02, -1.0677e-03, -4.7107e-03, -1.8706e-03,  1.0374e-01,\n",
      "        -1.1886e-03, -4.0165e-02, -4.2743e-02, -9.8375e-03, -6.6553e-03,\n",
      "        -3.3854e-03, -1.4327e-04, -7.3463e-03, -2.0531e-02, -1.9475e-01,\n",
      "        -2.4899e-02, -3.5841e-03, -1.0152e-02, -6.0960e-02, -1.0151e-03],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.00775008/1.0000000\n",
      "=====> Optimized acc: (tensor(0.4998, device='cuda:1'), 0.7, 0.7894736842105263)\n",
      "=====> Optimized weights: tensor([ 1.3612,  1.3600,  1.3609,  1.3605, -1.3612,  1.3601,  1.3612,  1.3612,\n",
      "         1.3611,  1.3610,  1.3608,  1.3518,  1.3610,  1.3612,  1.3612,  1.3612,\n",
      "         1.3609,  1.3611,  1.3612,  1.3599], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0140,  0.0042,  0.0485,  0.0004,  0.0032,  0.0019, -0.1022,  0.0051,\n",
      "         0.0189,  0.0121,  0.0009,  0.0007,  0.0357, -0.0395,  0.0206,  0.0017,\n",
      "         0.0092,  0.0003,  0.0014,  0.0053], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.00120181/1.0000000\n",
      "grad_weights: tensor([ 0.0126,  0.0042,  0.0436,  0.0003,  0.0027,  0.0018, -0.0748,  0.0045,\n",
      "         0.0165,  0.0100,  0.0009,  0.0007,  0.0329, -0.0299,  0.0182,  0.0013,\n",
      "         0.0082,  0.0002,  0.0009,  0.0049], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.00115435/1.0000000\n",
      "grad_weights: tensor([ 0.0104,  0.0039,  0.0360,  0.0002,  0.0021,  0.0014, -0.0536,  0.0036,\n",
      "         0.0132,  0.0078,  0.0007,  0.0006,  0.0284, -0.0215,  0.0148,  0.0009,\n",
      "         0.0067,  0.0002,  0.0005,  0.0039], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.00112747/1.0000000\n",
      "grad_weights: tensor([ 7.2989e-03,  3.1027e-03,  2.5891e-02,  9.4993e-05,  1.3569e-03,\n",
      "         9.4601e-04, -3.4813e-02,  2.2374e-03,  9.0324e-03,  5.6551e-03,\n",
      "         4.9879e-04,  3.3928e-04,  2.2359e-02, -1.4154e-02,  1.0552e-02,\n",
      "         4.1213e-04,  4.6050e-03,  1.0168e-04,  5.3622e-05,  2.2977e-03],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.00933451/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6020, device='cuda:1'), 0.8, 0.5)\n",
      "=====> Optimized weights: tensor([-7.6573, -7.7533, -7.6615, -7.4295, -7.5823, -7.6432,  7.4520, -7.6106,\n",
      "        -7.6256, -7.5925, -7.6633, -7.6318, -7.7047,  7.4815, -7.6453, -7.3989,\n",
      "        -7.6459, -7.5383, -7.0936, -7.6233], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([-4.1992e-02,  4.6998e-05,  2.6066e-02,  4.1182e-03,  8.9052e-02,\n",
      "         1.5858e-03,  2.1570e-04,  1.9351e-05,  1.6182e-02,  6.7284e-05,\n",
      "         3.4441e-03,  1.0678e-02, -3.7818e-02,  1.2482e-03,  1.0321e-03,\n",
      "         4.3760e-04,  1.2323e-02, -6.6761e-03,  2.3664e-03,  1.7754e-03],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.00398309/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5982, device='cuda:1'), 0.7, 0.3333333333333333)\n",
      "=====> Optimized weights: tensor([ 4.2257, -4.1378, -4.2257, -4.2248, -4.2258, -4.2232, -4.2063, -4.0182,\n",
      "        -4.2256, -4.1640, -4.2246, -4.2254,  4.2257, -4.2225, -4.2217, -4.2162,\n",
      "        -4.2255,  4.2252, -4.2241, -4.2235], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279]\n",
      "reset tmp model\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.6, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.00397398/1.0000000\n",
      "grad_weights: tensor([-0.0553, -0.0021, -0.0069, -0.0278, -0.0203, -0.3599, -0.1506,  0.3197,\n",
      "        -0.3374,  0.0510, -0.0082, -0.0112, -0.0204, -0.0418, -0.0321, -0.0012,\n",
      "        -0.0115, -0.0408,  0.2872, -0.0922], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.00196247/1.0000000\n",
      "grad_weights: tensor([-0.0056, -0.0002, -0.0010, -0.0040, -0.0017, -0.0293, -0.0119,  0.0204,\n",
      "        -0.0260,  0.0054, -0.0010, -0.0012, -0.0020, -0.0035, -0.0039, -0.0002,\n",
      "        -0.0016, -0.0056,  0.0251, -0.0082], device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.00872689/1.0000000\n",
      "=====> Optimized acc: (tensor(0.5038, device='cuda:1'), 0.9, 0.8235294117647058)\n",
      "=====> Optimized weights: tensor([ 0.5430,  0.5440,  0.5531,  0.5512,  0.5396,  0.5387,  0.5382, -0.5350,\n",
      "         0.5378, -0.5437,  0.5463,  0.5442,  0.5424,  0.5394,  0.5471,  0.5577,\n",
      "         0.5507,  0.5500, -0.5400,  0.5404], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00151003/1.0000000\n",
      "grad_weights: tensor([-8.4517e-04, -4.2916e-03, -4.9100e-05, -1.9558e-04,  1.0277e-02,\n",
      "         2.7199e-02,  9.3587e-03, -1.6120e-03, -7.7830e-04, -9.0928e-03,\n",
      "         3.9192e-02, -2.9181e-03, -3.4971e-04, -2.7086e-04, -9.4773e-04,\n",
      "         9.3229e-03,  1.3768e-02, -3.7246e-03, -2.5068e-02,  2.5066e-02],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.00157421/1.0000000\n",
      "=====> Optimized acc: (tensor(0.2987, device='cuda:1'), 0.8, 0.8461538461538461)\n",
      "=====> Optimized weights: tensor([ 2.6817,  2.6842,  2.6313,  2.6712, -2.6846, -2.6848, -2.6846,  2.6832,\n",
      "         2.6814,  2.6846, -2.6848,  2.6839,  2.6772,  2.6750,  2.6820, -2.6846,\n",
      "        -2.6847,  2.6841,  2.6847, -2.6847], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.00195506/1.0000000\n",
      "grad_weights: tensor([-0.0003, -0.0067, -0.0010, -0.0402, -0.0063, -0.0009, -0.0107,  0.0081,\n",
      "        -0.0036, -0.0208, -0.0001, -0.0015, -0.0036, -0.0018,  0.0677, -0.0047,\n",
      "        -0.0053, -0.0007, -0.0004,  0.0235], device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.00922685/1.0000000\n",
      "=====> Optimized acc: (tensor(0.6997, device='cuda:1'), 0.8, 0.8823529411764706)\n",
      "=====> Optimized weights: tensor([ 2.7717,  2.7812,  2.7787,  2.7815,  2.7812,  2.7784,  2.7813, -2.7813,\n",
      "         2.7808,  2.7815,  2.7622,  2.7798,  2.7808,  2.7801, -2.7816,  2.7810,\n",
      "         2.7811,  2.7778,  2.7750, -2.7815], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.5, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([-0.1476,  0.0038,  0.0148,  0.0341,  0.0460,  0.0011,  0.0008,  0.0189,\n",
      "         0.0036,  0.0011,  0.0026, -0.0151,  0.0032,  0.0090,  0.0045,  0.0099,\n",
      "         0.0070,  0.0009,  0.0031, -0.0230], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00118826/1.0000000\n",
      "grad_weights: tensor([-0.0890,  0.0031,  0.0117,  0.0277,  0.0351,  0.0008,  0.0006,  0.0149,\n",
      "         0.0027,  0.0008,  0.0022, -0.0088,  0.0027,  0.0072,  0.0035,  0.0074,\n",
      "         0.0054,  0.0009,  0.0022, -0.0152], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00114499/1.0000000\n",
      "grad_weights: tensor([-0.0482,  0.0023,  0.0081,  0.0200,  0.0214,  0.0006,  0.0004,  0.0105,\n",
      "         0.0016,  0.0005,  0.0015, -0.0047,  0.0020,  0.0050,  0.0022,  0.0047,\n",
      "         0.0035,  0.0007,  0.0012, -0.0085], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00112868/1.0000000\n",
      "grad_weights: tensor([-2.0530e-02,  1.2193e-03,  3.2860e-03,  8.7288e-03,  3.5925e-03,\n",
      "         2.0432e-04,  1.4941e-04,  5.1676e-03,  8.9714e-05,  7.8129e-05,\n",
      "         4.2658e-04, -1.9432e-03,  9.0963e-04,  1.8464e-03,  6.0412e-04,\n",
      "         1.4737e-03,  1.0311e-03,  3.1936e-04,  2.4273e-04, -2.2945e-03],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00111766/1.0000000\n",
      "grad_weights: tensor([-5.4552e-03,  1.1696e-04, -1.4057e-03, -2.4241e-03, -1.3283e-02,\n",
      "        -1.8755e-04, -8.7863e-05,  3.4414e-04, -1.3596e-03, -2.8993e-04,\n",
      "        -6.9383e-04, -3.1432e-04, -2.3523e-04, -1.1950e-03, -1.1185e-03,\n",
      "        -1.5494e-03, -1.3978e-03, -2.2767e-04, -5.5752e-04,  2.1090e-03],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.00392362/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3014, device='cuda:1'), 0.7, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([  9.4775, -10.1700,  -9.8787,  -9.9847,  -9.3689,  -9.7548,  -9.7636,\n",
      "        -10.0475,  -9.1200,  -9.3132,  -9.6696,   9.3927, -10.0350,  -9.8281,\n",
      "         -9.5365,  -9.6261,  -9.6156, -10.0606,  -9.3465,   9.4051],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0040,  0.0055,  0.0006,  0.0395, -0.0402,  0.0228,  0.0646,  0.0007,\n",
      "         0.0077,  0.0036, -0.0039,  0.0028,  0.0377,  0.0005,  0.0003,  0.0007,\n",
      "        -0.1203,  0.0004,  0.0004,  0.0018], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00117656/1.0000000\n",
      "grad_weights: tensor([ 0.0029,  0.0037,  0.0004,  0.0304, -0.0222,  0.0170,  0.0511,  0.0005,\n",
      "         0.0076,  0.0025, -0.0027,  0.0022,  0.0399,  0.0005,  0.0002,  0.0005,\n",
      "        -0.0700,  0.0003,  0.0003,  0.0012], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00113344/1.0000000\n",
      "grad_weights: tensor([ 1.6953e-03,  1.9491e-03,  1.0850e-04,  1.7595e-02, -9.6742e-03,\n",
      "         1.0080e-02,  2.7620e-02,  1.4993e-04,  5.3858e-03,  1.0830e-03,\n",
      "        -1.6520e-03,  1.2150e-03,  3.2619e-02,  3.2142e-04,  9.4038e-05,\n",
      "         2.4720e-04, -2.9275e-02,  1.0029e-04,  1.0559e-04,  5.1241e-04],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00111632/1.0000000\n",
      "grad_weights: tensor([ 3.6095e-04,  1.4380e-04, -2.9261e-04, -9.7584e-05, -8.5439e-04,\n",
      "         1.5697e-03, -8.2735e-03, -2.4760e-04, -7.5779e-04, -7.5561e-04,\n",
      "        -7.6503e-04, -3.9052e-04,  9.6943e-03, -3.7352e-05, -8.4119e-05,\n",
      "        -1.8474e-04,  3.7927e-03, -1.6663e-04, -7.1205e-05, -3.1015e-04],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.00764315/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4864, device='cuda:1'), 0.8, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-10.2655, -10.0729,  -8.9487, -10.2213,   9.7269, -10.2887, -10.0485,\n",
      "         -9.2402, -10.3913,  -9.6597,  10.3509, -10.0451, -10.7950, -10.3293,\n",
      "         -9.5350,  -9.6932,   9.6994,  -9.2255,  -9.6022,  -9.6757],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.7, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.00216701/1.0000000\n",
      "grad_weights: tensor([-3.1784e-02, -6.0748e-02,  8.3200e-03, -2.6333e-02, -9.0803e-04,\n",
      "        -1.6783e-02, -1.9195e-02, -1.9120e-03, -3.2973e-05, -6.0830e-02,\n",
      "        -3.4845e-04, -3.3908e-03, -1.8743e-02,  2.2377e-01, -3.8233e-03,\n",
      "        -6.8132e-03, -8.3933e-04, -2.9641e-03, -6.9271e-03, -1.7670e-04],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.01491414/1.0000000\n",
      "=====> Optimized acc: (tensor(0.5022, device='cuda:1'), 0.8, 0.7777777777777778)\n",
      "=====> Optimized weights: tensor([ 1.4677,  1.4677, -1.4676,  1.4677,  1.4661,  1.4676,  1.4677,  1.4670,\n",
      "         1.4245,  1.4677,  1.4635,  1.4673,  1.4677, -1.4677,  1.4674,  1.4675,\n",
      "         1.4660,  1.4672,  1.4675,  1.4595], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.00981004/1.0000000\n",
      "grad_weights: tensor([ 0.0340,  0.0455,  0.0663,  0.0752,  0.3599,  0.6391,  0.0028, -0.2053,\n",
      "         0.1383,  0.2384,  0.0109,  0.0326,  0.0112, -0.0887,  0.0419,  0.1082,\n",
      "         0.0361,  0.1336,  0.0126,  0.0888], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.00124759/1.0000000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "grad_weights: tensor([ 0.0059,  0.0080,  0.0120,  0.0132,  0.0652,  0.1183,  0.0005, -0.0378,\n",
      "         0.0247,  0.0432,  0.0020,  0.0057,  0.0019, -0.0152,  0.0073,  0.0191,\n",
      "         0.0063,  0.0228,  0.0023,  0.0166], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.00204867/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5997, device='cuda:1'), 0.8, 0.5)\n",
      "=====> Optimized weights: tensor([-0.2696, -0.2700, -0.2704, -0.2699, -0.2705, -0.2708, -0.2701,  0.2707,\n",
      "        -0.2702, -0.2704, -0.2703, -0.2699, -0.2694,  0.2696, -0.2698, -0.2701,\n",
      "        -0.2698, -0.2695, -0.2703, -0.2710], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00921451/1.0000000\n",
      "grad_weights: tensor([ 2.6949e-02,  4.7519e-02, -2.8912e-02,  5.5263e-02, -1.2748e-01,\n",
      "         9.8981e-03,  4.7787e-04,  1.3328e-02,  3.1124e-01,  3.7002e-02,\n",
      "         3.0886e-02,  2.1444e-02,  2.1261e-02, -2.2342e-01,  2.4700e-02,\n",
      "         1.7723e-04,  1.3847e-02,  2.9121e-03,  7.6217e-02,  8.5928e-02],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00124712/1.0000000\n",
      "grad_weights: tensor([ 4.3727e-03,  7.2054e-03, -4.4776e-03,  8.8253e-03, -2.3355e-02,\n",
      "         1.5846e-03,  7.7759e-05,  2.0762e-03,  4.9333e-02,  5.7762e-03,\n",
      "         5.3297e-03,  3.4333e-03,  3.3918e-03, -3.4016e-02,  3.9942e-03,\n",
      "        -2.8516e-06,  2.1662e-03,  4.6045e-04,  1.2737e-02,  1.3417e-02],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00124181/1.0000000\n",
      "grad_weights: tensor([ 4.3065e-03,  7.1113e-03, -4.3362e-03,  8.7161e-03, -2.2917e-02,\n",
      "         1.5646e-03,  7.6302e-05,  2.0492e-03,  4.8982e-02,  5.6729e-03,\n",
      "         5.2346e-03,  3.4130e-03,  3.3642e-03, -3.3040e-02,  3.9174e-03,\n",
      "        -6.4241e-06,  2.1310e-03,  4.5518e-04,  1.2540e-02,  1.3256e-02],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.00644618/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4089, device='cuda:1'), 0.8, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-0.9189, -0.9127,  0.9140, -0.9175,  0.9308, -0.9176, -0.9165, -0.9151,\n",
      "        -0.9169, -0.9152, -0.9247, -0.9179, -0.9175,  0.9126, -0.9184, -0.7895,\n",
      "        -0.9154, -0.9162, -0.9217, -0.9154], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491]\n",
      "=====> init acc: (tensor(0.8000, device='cuda:1'), 1.0, 0.9)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 3.6128e-04,  4.8217e-01,  2.0121e-02,  1.6264e-04,  7.9135e-04,\n",
      "         1.6974e-02,  7.0812e-04,  3.5236e-02, -3.4088e-02,  2.4540e-03,\n",
      "        -1.3290e-02,  3.2318e-03, -4.9219e-02,  2.2740e-03,  8.8075e-03,\n",
      "         8.2738e-04,  4.4583e-03,  1.6324e-02,  4.7147e-03,  1.7244e-03],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.00828410/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.7004, device='cuda:1'), 0.8, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-2.2368, -2.2430, -2.2429, -2.2293, -2.2402, -2.2429, -2.2399, -2.2430,\n",
      "         2.2430, -2.2421,  2.2428, -2.2423,  2.2430, -2.2420, -2.2428, -2.2403,\n",
      "        -2.2425, -2.2429, -2.2425, -2.2417], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.00275715/1.0000000\n",
      "grad_weights: tensor([-0.0011, -0.0439, -0.0584, -0.0165, -0.0199,  0.0776, -0.1759, -0.0249,\n",
      "        -0.0043, -0.0018, -0.0097, -0.0012, -0.0140, -0.0154, -0.0142,  0.0286,\n",
      "        -0.0014, -0.0566, -0.0821, -0.0316], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.00270389/1.0000000\n",
      "grad_weights: tensor([-0.0010, -0.0402, -0.0505, -0.0156, -0.0178,  0.0756, -0.1555, -0.0221,\n",
      "        -0.0038, -0.0017, -0.0094, -0.0010, -0.0121, -0.0141, -0.0125,  0.0270,\n",
      "        -0.0013, -0.0539, -0.0617, -0.0282], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.00131615/1.0000000\n",
      "grad_weights: tensor([ 0.0002,  0.0245,  0.0484,  0.0105,  0.0124, -0.0857,  0.1523,  0.0147,\n",
      "         0.0039,  0.0010,  0.0051,  0.0008,  0.0093,  0.0158,  0.0094, -0.0200,\n",
      "         0.0005,  0.0351,  0.0394,  0.0195], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.00132812/1.0000000\n",
      "=====> Optimized acc: (tensor(0.8119, device='cuda:1'), 1.0, 0.8888888888888888)\n",
      "=====> Optimized weights: tensor([ 1.6090,  1.4913,  1.3937,  1.4689,  1.4658, -1.3354,  1.3860,  1.4753,\n",
      "         1.3703,  1.5006,  1.5094,  1.4520,  1.4470,  1.3469,  1.4504, -1.4491,\n",
      "         1.5610,  1.4760,  1.4892,  1.4677], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14]\n",
      "reset tmp model\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.9, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.00125969/1.0000000\n",
      "grad_weights: tensor([ 1.2567e-02,  1.5279e-02, -1.8238e-03,  1.3216e-01,  2.1800e-02,\n",
      "         5.5050e-04,  3.2724e-02,  1.3302e-02,  4.0114e-04,  1.2574e-01,\n",
      "        -2.8283e-03,  3.5969e-03,  6.8980e-03,  4.0846e-05,  2.5746e-02,\n",
      "         3.0476e-03,  2.6806e-04,  4.7206e-04, -5.4154e-02, -4.5255e-02],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.00276477/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5995, device='cuda:1'), 0.7, 0.5)\n",
      "=====> Optimized weights: tensor([-1.4496, -1.4496,  1.4489, -1.4497, -1.4496, -1.4471, -1.4497, -1.4496,\n",
      "        -1.4461, -1.4497,  1.4492, -1.4493, -1.4495, -1.4151, -1.4496, -1.4492,\n",
      "        -1.4443, -1.4466,  1.4497,  1.4497], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.7, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 1.3243e-01,  1.8179e-02,  2.4285e-03,  1.8789e-02,  3.6444e-04,\n",
      "         3.3818e-02,  3.8417e-02,  3.4370e-04,  3.1285e-03,  1.0855e-03,\n",
      "         1.9905e-03,  3.1347e-04,  4.3722e-03,  1.0158e-04,  6.4363e-03,\n",
      "         1.2809e-03, -5.0853e-02,  7.1472e-03,  1.8185e-03,  5.9145e-02],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00117055/1.0000000\n",
      "grad_weights: tensor([ 7.8682e-02,  1.1693e-02,  1.4225e-03,  9.7914e-03,  1.0880e-04,\n",
      "         4.3939e-02,  2.3398e-02,  2.0093e-04,  2.4365e-03,  7.2163e-04,\n",
      "         1.3784e-03,  1.3362e-04,  2.5136e-03,  6.3276e-05,  3.3427e-03,\n",
      "         7.2456e-04, -2.1683e-02,  4.2508e-03,  1.0877e-03,  4.0844e-02],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00112367/1.0000000\n",
      "grad_weights: tensor([ 6.8258e-03,  4.0061e-03,  2.2867e-04, -1.9680e-03, -1.5836e-04,\n",
      "         2.7071e-02, -1.4592e-05,  5.5360e-05,  3.1942e-04,  1.0530e-04,\n",
      "         5.4578e-05, -9.4559e-05, -2.0540e-05,  1.6448e-05, -7.0729e-04,\n",
      "         7.6977e-06, -1.4260e-03,  5.7417e-04,  1.6986e-04,  1.7199e-02],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.00566727/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3831, device='cuda:1'), 0.8, 1.0)\n",
      "=====> Optimized weights: tensor([-8.7036, -9.0037, -8.7583, -8.3138, -7.0700, -9.5001, -8.6327, -8.8311,\n",
      "        -8.9368, -8.8409, -8.7598, -7.6855, -8.5801, -8.8015, -8.2996, -8.5809,\n",
      "         8.3958, -8.7500, -8.7704, -9.1270], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.6, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 4.0773e-05,  1.5637e-02,  1.7554e-02,  3.6527e-03,  6.8104e-02,\n",
      "         3.3439e-02,  3.8971e-03,  5.0099e-02,  1.5801e-02,  8.3156e-04,\n",
      "         5.4386e-03,  3.3783e-03, -3.0848e-02,  2.6375e-04,  1.0739e-03,\n",
      "         8.3126e-03,  1.0670e-03,  2.3177e-04,  4.2443e-04,  2.3848e-04],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.00119327/1.0000000\n",
      "grad_weights: tensor([ 2.5985e-05,  1.2340e-02,  1.5549e-02,  2.8540e-03,  5.2883e-02,\n",
      "         2.7220e-02,  3.2070e-03,  4.2586e-02,  1.4065e-02,  6.1544e-04,\n",
      "         4.4346e-03,  2.8294e-03, -2.0878e-02,  2.1538e-04,  7.7159e-04,\n",
      "         6.7890e-03,  1.2149e-03,  1.6712e-04,  3.7293e-04,  1.9605e-04],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.00794481/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.2985, device='cuda:1'), 0.8, 1.0)\n",
      "=====> Optimized weights: tensor([-5.2392, -5.4396, -5.4615, -5.4361, -5.4361, -5.4465, -5.4474, -5.4549,\n",
      "        -5.4622, -5.4174, -5.4459, -5.4506,  5.3988, -5.4257, -5.4110, -5.4466,\n",
      "        -5.4740, -5.3924, -5.4473, -5.4248], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.9, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.00197197/1.0000000\n",
      "grad_weights: tensor([-8.0615e-04, -8.6225e-03,  3.3896e-02, -1.0760e-02, -1.8770e-03,\n",
      "        -4.9211e-05, -7.4801e-03, -1.1458e-02, -2.5879e-02, -1.0002e-02,\n",
      "         1.8081e-02,  1.3208e-03, -1.1912e-04, -1.3302e-02, -1.2049e-03,\n",
      "         5.0360e-04, -9.0886e-03, -2.3356e-04, -2.3442e-05, -4.5245e-03],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.00306295/1.0000000\n",
      "=====> Optimized acc: (tensor(0.2976, device='cuda:1'), 0.7, 0.75)\n",
      "=====> Optimized weights: tensor([ 2.2075,  2.2099, -2.2101,  2.2100,  2.2090,  2.1662,  2.2099,  2.2100,\n",
      "         2.2101,  2.2100, -2.2101, -2.2085,  2.1918,  2.2100,  2.2084, -2.2058,\n",
      "         2.2100,  2.2008,  2.1198,  2.2097], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.8, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.00125503/1.0000000\n",
      "grad_weights: tensor([ 0.0044,  0.0640,  0.0061,  0.0012,  0.0003,  0.0137,  0.0094,  0.0004,\n",
      "         0.0007,  0.0007,  0.0117,  0.0013,  0.0150,  0.0047, -0.0827,  0.0002,\n",
      "         0.0306,  0.0033,  0.0137,  0.0062], device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.00661084/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.2997, device='cuda:1'), 0.7, 1.0)\n",
      "=====> Optimized weights: tensor([-2.1442, -2.1446, -2.1443, -2.1428, -2.1381, -2.1445, -2.1444, -2.1395,\n",
      "        -2.1418, -2.1417, -2.1445, -2.1429, -2.1445, -2.1442,  2.1446, -2.1356,\n",
      "        -2.1446, -2.1440, -2.1445, -2.1443], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828]\n",
      "=====> init acc: (tensor(0.8000, device='cuda:1'), 0.8, 0.9)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 6.8365e-03,  7.3943e-04,  1.4957e-02,  8.1278e-04,  1.5479e-03,\n",
      "         8.2244e-03,  5.0617e-04,  4.4348e-04,  1.4909e-03,  3.0814e-02,\n",
      "         1.4139e-03,  3.6622e-04, -1.8403e-01,  7.8493e-03,  8.4743e-04,\n",
      "         1.6174e-02,  8.7725e-05,  4.3191e-02,  4.2645e-03,  1.3528e-02],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.00342160/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6996, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-6.4593, -6.4515, -6.4598, -6.4523, -6.4561, -6.4595, -6.4475, -6.4457,\n",
      "        -6.4559, -6.4600, -6.4557, -6.4427,  6.4602, -6.4594, -6.4526, -6.4599,\n",
      "        -6.3874, -6.4601, -6.4587, -6.4598], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636]\n",
      "=====> init acc: (tensor(0.8000, device='cuda:1'), 0.8, 0.9)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 1.2928e-02,  5.0564e-05,  8.8076e-03,  3.7530e-04,  6.1431e-03,\n",
      "         8.9078e-03,  3.9516e-03,  4.0326e-03,  1.9282e-04,  2.2575e-02,\n",
      "        -2.0979e-02,  4.1245e-01,  9.5347e-03,  5.9943e-02, -1.4612e-01,\n",
      "         6.4272e-02, -4.7358e-02,  2.0868e-02,  3.9816e-04,  1.9622e-02],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00117621/1.0000000\n",
      "grad_weights: tensor([ 8.9410e-03,  3.6070e-05,  6.9518e-03,  2.3281e-04,  3.9041e-03,\n",
      "         7.5773e-03,  3.4189e-03,  3.1252e-03,  1.6484e-04,  2.0112e-02,\n",
      "        -1.3778e-02,  3.0960e-01,  7.5923e-03,  5.8874e-02, -9.3063e-02,\n",
      "         4.7981e-02, -3.4502e-02,  1.4834e-02,  2.9278e-04,  1.5590e-02],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00112887/1.0000000\n",
      "grad_weights: tensor([ 4.2256e-03,  1.8985e-05,  4.5392e-03,  8.4887e-05,  1.5925e-03,\n",
      "         5.2819e-03,  2.2903e-03,  2.1014e-03,  9.6699e-05,  1.3969e-02,\n",
      "        -8.2832e-03,  1.8868e-01,  4.7637e-03,  4.7308e-02, -5.0091e-02,\n",
      "         2.9792e-02, -2.2839e-02,  8.5453e-03,  1.5152e-04,  9.9623e-03],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.00644067/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4988, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-3.0074, -2.9602, -3.0768, -2.9402, -2.9673, -3.0986, -3.0969, -3.0755,\n",
      "        -3.0636, -3.1062,  3.0203, -3.0578, -3.0742, -3.1319,  2.9986, -3.0586,\n",
      "         3.0599, -3.0374, -3.0252, -3.0760], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.9, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00125794/1.0000000\n",
      "grad_weights: tensor([-3.6086e-02,  7.4642e-05,  1.9498e-02,  3.1567e-03,  1.2028e-04,\n",
      "         1.3328e-03,  1.5731e-02,  1.4690e-02, -1.7137e-02,  2.2040e-03,\n",
      "         2.9707e-02,  3.2271e-03,  3.1239e-04,  2.9944e-02,  5.3402e-03,\n",
      "         5.7182e-02,  1.0210e-03, -6.1838e-02,  6.5619e-03,  1.3311e-03],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00120355/1.0000000\n",
      "grad_weights: tensor([-2.6890e-02,  4.2111e-05,  1.6598e-02,  2.3951e-03,  9.9682e-05,\n",
      "         1.0872e-03,  1.3408e-02,  1.2441e-02, -1.2730e-02,  1.8928e-03,\n",
      "         2.5087e-02,  2.3905e-03,  1.6148e-04,  2.5918e-02,  4.1491e-03,\n",
      "         4.7656e-02,  9.5369e-04, -4.6489e-02,  6.1957e-03,  1.1300e-03],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00116502/1.0000000\n",
      "grad_weights: tensor([-1.9168e-02,  1.1710e-05,  1.3659e-02,  1.6887e-03,  7.7047e-05,\n",
      "         8.5049e-04,  1.1048e-02,  1.0318e-02, -8.9727e-03,  1.5444e-03,\n",
      "         2.0136e-02,  1.5615e-03,  2.4134e-05,  2.1302e-02,  3.0318e-03,\n",
      "         3.8566e-02,  8.4341e-04, -3.3838e-02,  5.0353e-03,  9.0362e-04],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00113496/1.0000000\n",
      "grad_weights: tensor([-1.2206e-02, -1.8462e-05,  1.0298e-02,  9.7092e-04,  4.8637e-05,\n",
      "         5.9390e-04,  8.3119e-03,  8.0038e-03, -5.6020e-03,  1.0193e-03,\n",
      "         1.4319e-02,  6.9709e-04, -1.1082e-04,  1.5436e-02,  1.8586e-03,\n",
      "         2.9040e-02,  6.5041e-04, -2.2694e-02,  3.5156e-03,  6.0432e-04],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00111971/1.0000000\n",
      "grad_weights: tensor([-5.8465e-03, -5.2126e-05,  6.4912e-03,  1.9353e-04,  1.3741e-05,\n",
      "         3.1995e-04,  5.2805e-03,  5.4936e-03, -2.5833e-03,  3.0308e-04,\n",
      "         7.4037e-03, -2.5416e-04, -2.5415e-04,  8.3705e-03,  6.1572e-04,\n",
      "         1.9399e-02,  3.4302e-04, -1.3115e-02,  1.6045e-03,  2.2981e-04],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00111367/1.0000000\n",
      "grad_weights: tensor([-4.5298e-04, -8.4511e-05,  2.6540e-03, -5.4494e-04, -2.3991e-05,\n",
      "         4.3631e-05,  2.0609e-03,  3.0181e-03, -1.5481e-05, -5.4753e-04,\n",
      "         2.8819e-05, -1.2079e-03, -3.8657e-04,  5.7917e-04, -6.1680e-04,\n",
      "         9.9666e-03, -6.8251e-05, -5.1449e-03, -5.8670e-04, -2.0339e-04],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.00111478/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6785, device='cuda:1'), 0.7, 0.0)\n",
      "=====> Optimized weights: tensor([ 10.0110,  -5.7823, -10.5459,  -9.7161,  -9.8770, -10.2993, -10.5461,\n",
      "        -10.6235,   9.9678, -10.0609, -10.3518,  -9.1540,  -5.1524, -10.4317,\n",
      "         -9.9143, -10.5448, -10.5265,  10.1606, -10.3615, -10.1420],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.00125223/1.0000000\n",
      "grad_weights: tensor([ 0.0286,  0.0020,  0.0019,  0.0013,  0.0060,  0.0027,  0.0040,  0.0414,\n",
      "         0.0003, -0.0409,  0.0294,  0.0004,  0.0155,  0.0304,  0.0057,  0.0276,\n",
      "         0.0669,  0.0108,  0.0061,  0.0026], device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.00948678/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.7001, device='cuda:1'), 0.8, 0.0)\n",
      "=====> Optimized weights: tensor([-1.6631, -1.6624, -1.6623, -1.6619, -1.6629, -1.6626, -1.6628, -1.6632,\n",
      "        -1.6584,  1.6632, -1.6631, -1.6586, -1.6631, -1.6632, -1.6629, -1.6631,\n",
      "        -1.6632, -1.6631, -1.6629, -1.6626], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.9, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.00126357/1.0000000\n",
      "grad_weights: tensor([ 0.0671, -0.0700,  0.0038, -0.1278,  0.0004, -0.0747,  0.0004,  0.0077,\n",
      "         0.0080,  0.0079,  0.0066, -0.0500,  0.0028,  0.0013,  0.0139,  0.0269,\n",
      "        -0.0021,  0.0107,  0.0008,  0.0068], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.00223453/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4998, device='cuda:1'), 0.7, 0.4)\n",
      "=====> Optimized weights: tensor([-1.2955,  1.2955, -1.2951,  1.2955, -1.2920,  1.2955, -1.2923, -1.2953,\n",
      "        -1.2953, -1.2953, -1.2953,  1.2954, -1.2950, -1.2945, -1.2954, -1.2954,\n",
      "         1.2949, -1.2954, -1.2939, -1.2953], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260]\n",
      "reset tmp model\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.7, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0019,  0.0224,  0.0174,  0.0104, -0.1959,  0.0100,  0.0761,  0.0124,\n",
      "         0.0008,  0.0004,  0.0159,  0.0138,  0.0024,  0.0485, -0.0166,  0.0042,\n",
      "         0.0340,  0.0521, -0.0353,  0.0013], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00121062/1.0000000\n",
      "grad_weights: tensor([ 0.0017,  0.0202,  0.0153,  0.0089, -0.1596,  0.0089,  0.0719,  0.0112,\n",
      "         0.0006,  0.0004,  0.0146,  0.0122,  0.0022,  0.0437, -0.0119,  0.0039,\n",
      "         0.0300,  0.0452, -0.0290,  0.0011], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00118444/1.0000000\n",
      "grad_weights: tensor([ 0.0015,  0.0179,  0.0133,  0.0075, -0.1281,  0.0079,  0.0671,  0.0100,\n",
      "         0.0005,  0.0004,  0.0134,  0.0108,  0.0019,  0.0390, -0.0084,  0.0036,\n",
      "         0.0264,  0.0387, -0.0237,  0.0009], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00115957/1.0000000\n",
      "grad_weights: tensor([ 0.0012,  0.0149,  0.0109,  0.0059, -0.0972,  0.0067,  0.0585,  0.0083,\n",
      "         0.0003,  0.0003,  0.0116,  0.0090,  0.0016,  0.0330, -0.0058,  0.0031,\n",
      "         0.0226,  0.0315, -0.0186,  0.0007], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.00318889/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3006, device='cuda:1'), 0.7, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-2.8636, -2.8745, -2.8672, -2.8549,  2.8349, -2.8739, -2.8895, -2.8747,\n",
      "        -2.7963, -2.8713, -2.8833, -2.8712, -2.8775, -2.8763,  2.7705, -2.8850,\n",
      "        -2.8717, -2.8620,  2.8417, -2.8412], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0058,  0.0185,  0.0031,  0.0077,  0.0146,  0.0154,  0.0007,  0.0097,\n",
      "         0.0005,  0.0316, -0.0361,  0.0018,  0.0245,  0.0019,  0.0258, -0.0029,\n",
      "         0.0084,  0.0699,  0.0062,  0.0013], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00121939/1.0000000\n",
      "grad_weights: tensor([ 0.0052,  0.0162,  0.0028,  0.0070,  0.0132,  0.0141,  0.0006,  0.0088,\n",
      "         0.0005,  0.0289, -0.0311,  0.0016,  0.0240,  0.0017,  0.0236, -0.0024,\n",
      "         0.0079,  0.0652,  0.0054,  0.0011], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00118975/1.0000000\n",
      "grad_weights: tensor([ 0.0047,  0.0138,  0.0025,  0.0062,  0.0116,  0.0127,  0.0004,  0.0079,\n",
      "         0.0004,  0.0261, -0.0264,  0.0014,  0.0230,  0.0014,  0.0211, -0.0020,\n",
      "         0.0073,  0.0594,  0.0045,  0.0010], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00116720/1.0000000\n",
      "grad_weights: tensor([ 0.0039,  0.0115,  0.0021,  0.0054,  0.0097,  0.0112,  0.0003,  0.0068,\n",
      "         0.0004,  0.0231, -0.0220,  0.0011,  0.0213,  0.0012,  0.0182, -0.0017,\n",
      "         0.0065,  0.0512,  0.0036,  0.0008], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00114529/1.0000000\n",
      "grad_weights: tensor([ 0.0031,  0.0091,  0.0018,  0.0046,  0.0080,  0.0098,  0.0001,  0.0058,\n",
      "         0.0003,  0.0202, -0.0182,  0.0008,  0.0193,  0.0009,  0.0152, -0.0013,\n",
      "         0.0057,  0.0431,  0.0028,  0.0006], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00113026/1.0000000\n",
      "grad_weights: tensor([ 2.2272e-03,  6.4607e-03,  1.4672e-03,  3.7026e-03,  5.9129e-03,\n",
      "         8.2375e-03, -5.1325e-05,  4.6729e-03,  2.7273e-04,  1.7329e-02,\n",
      "        -1.4591e-02,  5.3659e-04,  1.6260e-02,  6.2565e-04,  1.1823e-02,\n",
      "        -1.0511e-03,  4.6005e-03,  3.2924e-02,  1.8312e-03,  4.1671e-04],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.00771243/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.3984, device='cuda:1'), 0.9, 1.0)\n",
      "=====> Optimized weights: tensor([-7.5582, -7.5073, -7.5941, -7.6014, -7.5612, -7.6367, -6.9119, -7.6026,\n",
      "        -7.6540, -7.6387,  7.5163, -7.4714, -7.7194, -7.4806, -7.6005,  7.4724,\n",
      "        -7.6629, -7.6202, -7.4573, -7.4496], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 1.2428e-02,  6.8004e-04,  1.2485e-02,  3.4553e-02,  6.2968e-03,\n",
      "        -2.5716e-01,  1.5171e-03,  7.9771e-04,  4.1866e-03,  1.6872e-01,\n",
      "         5.0034e-05,  3.3890e-03,  1.0703e-02,  5.6871e-03,  5.6330e-03,\n",
      "         5.4517e-03,  3.4250e-03,  6.2218e-04, -8.5825e-03,  8.0244e-05],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00117351/1.0000000\n",
      "grad_weights: tensor([ 1.0470e-02,  5.0044e-04,  9.1246e-03,  2.5062e-02,  4.1383e-03,\n",
      "        -1.1774e-01,  1.0713e-03,  6.4412e-04,  2.9048e-03,  1.4582e-01,\n",
      "         1.6098e-05,  2.1716e-03,  7.1521e-03,  3.4773e-03,  4.3733e-03,\n",
      "         4.0089e-03,  2.4795e-03,  3.7214e-04, -5.8959e-03,  4.2396e-05],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00113093/1.0000000\n",
      "grad_weights: tensor([ 6.1661e-03,  1.9310e-04,  5.3193e-03,  1.4418e-02,  1.6602e-03,\n",
      "        -3.4172e-02,  3.8535e-04,  2.6246e-04,  1.3709e-03,  8.4064e-02,\n",
      "        -2.0478e-05,  7.4896e-04,  3.6399e-03,  1.2170e-03,  2.3719e-03,\n",
      "         1.7155e-03,  1.2723e-03,  1.1429e-04, -3.5293e-03,  2.3428e-07],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00112101/1.0000000\n",
      "grad_weights: tensor([-2.0096e-03, -2.8818e-04,  1.1193e-03,  2.0381e-03, -1.1876e-03,\n",
      "         5.7554e-03, -6.4407e-04, -5.0142e-04, -5.4317e-04, -1.1783e-02,\n",
      "        -6.1391e-05, -9.0178e-04, -4.5220e-05, -1.1882e-03, -5.5990e-04,\n",
      "        -1.7905e-03, -2.1425e-04, -1.6467e-04, -1.3531e-03, -4.8766e-05],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.00698297/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5751, device='cuda:1'), 0.9, 0.5)\n",
      "=====> Optimized weights: tensor([-6.6698, -6.1592, -6.7853, -6.7530, -6.3313,  6.1077, -6.1081, -6.0519,\n",
      "        -6.4860, -6.7525, -3.6629, -6.1828, -6.5997, -6.2089, -6.6431, -6.3007,\n",
      "        -6.6077, -6.0840,  6.8025, -5.2707], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.5, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.01161456/1.0000000\n",
      "grad_weights: tensor([ 0.1228,  0.0044,  0.1691,  0.0041, -0.7425,  1.3740,  0.1212,  0.0187,\n",
      "         0.0035,  0.0572,  0.1451, -0.3755,  0.0419,  0.0450,  0.0292,  0.0064,\n",
      "         0.0472,  0.1620,  0.0222,  0.0398], device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.00783183/1.0000000\n",
      "grad_weights: tensor([ 0.1024,  0.0036,  0.1407,  0.0035, -0.5612,  1.0865,  0.0969,  0.0148,\n",
      "         0.0030,  0.0449,  0.1222, -0.2858,  0.0349,  0.0369,  0.0236,  0.0055,\n",
      "         0.0366,  0.1285,  0.0177,  0.0326], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.00123690/1.0000000\n",
      "grad_weights: tensor([ 0.0135,  0.0005,  0.0196,  0.0003, -0.0796,  0.1524,  0.0132,  0.0017,\n",
      "         0.0004,  0.0062,  0.0155, -0.0401,  0.0045,  0.0048,  0.0026,  0.0007,\n",
      "         0.0049,  0.0163,  0.0023,  0.0043], device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.01003928/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.2000, device='cuda:1'), 0.8, 1.0)\n",
      "=====> Optimized weights: tensor([-0.6234, -0.6228, -0.6239, -0.6202,  0.6204, -0.6222, -0.6223, -0.6204,\n",
      "        -0.6243, -0.6218, -0.6234,  0.6206, -0.6232, -0.6227, -0.6204, -0.6241,\n",
      "        -0.6208, -0.6213, -0.6214, -0.6229], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.8, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.00983997/1.0000000\n",
      "grad_weights: tensor([ 0.0400,  0.0616,  0.0208,  0.0366,  0.0045,  0.0043,  0.0150,  0.0888,\n",
      "         0.0344,  0.0016,  0.0615, -0.6685,  0.0012, -0.2387,  0.0040,  0.0104,\n",
      "         0.0523,  0.0149,  0.0034,  0.0009], device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.00766981/1.0000000\n",
      "grad_weights: tensor([ 0.0294,  0.0447,  0.0152,  0.0246,  0.0032,  0.0028,  0.0107,  0.0652,\n",
      "         0.0241,  0.0010,  0.0458, -0.4703,  0.0009, -0.1679,  0.0027,  0.0076,\n",
      "         0.0385,  0.0108,  0.0025,  0.0006], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.00123184/1.0000000\n",
      "grad_weights: tensor([ 4.7170e-03,  7.5170e-03,  2.3047e-03,  3.9491e-03,  5.5305e-04,\n",
      "         4.2952e-04,  1.6202e-03,  1.0670e-02,  3.9002e-03,  1.2319e-04,\n",
      "         7.4419e-03, -7.7833e-02,  1.4537e-04, -2.8593e-02,  4.4496e-04,\n",
      "         1.0541e-03,  6.4474e-03,  1.7166e-03,  4.1605e-04,  6.8210e-05],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.00122325/1.0000000\n",
      "grad_weights: tensor([ 4.6187e-03,  7.3296e-03,  2.2247e-03,  3.8118e-03,  5.3816e-04,\n",
      "         4.1295e-04,  1.5573e-03,  1.0530e-02,  3.7777e-03,  1.1526e-04,\n",
      "         7.3222e-03, -7.4052e-02,  1.4373e-04, -2.7210e-02,  4.3048e-04,\n",
      "         1.0088e-03,  6.2950e-03,  1.6888e-03,  4.0613e-04,  6.2957e-05],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.00120636/1.0000000\n",
      "grad_weights: tensor([ 4.4632e-03,  7.0790e-03,  2.1171e-03,  3.6344e-03,  5.1898e-04,\n",
      "         3.9232e-04,  1.4802e-03,  1.0255e-02,  3.6156e-03,  1.0585e-04,\n",
      "         7.1138e-03, -6.9877e-02,  1.4033e-04, -2.5716e-02,  4.1176e-04,\n",
      "         9.4923e-04,  6.0858e-03,  1.6392e-03,  3.9225e-04,  5.6846e-05],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.00971695/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6982, device='cuda:1'), 0.9, 0.5)\n",
      "=====> Optimized weights: tensor([-2.7747, -2.7789, -2.7613, -2.7456, -2.7784, -2.7295, -2.7538, -2.7790,\n",
      "        -2.7601, -2.6734, -2.7817,  2.7636, -2.7798,  2.7686, -2.7489, -2.7460,\n",
      "        -2.7827, -2.7698, -2.7750, -2.6728], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.7, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.00785557/1.0000000\n",
      "grad_weights: tensor([-0.6133,  0.0852,  0.0534, -0.0948,  0.0029,  0.0017,  0.0530, -0.0815,\n",
      "         0.0434,  0.1347,  0.1302,  0.1273,  0.0007,  0.1033, -0.0583,  0.0011,\n",
      "         0.0177,  0.0066,  0.1379,  0.0012], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.00208947/1.0000000\n",
      "grad_weights: tensor([ 0.0575, -0.0102, -0.0098,  0.0125, -0.0005, -0.0004, -0.0068,  0.0083,\n",
      "        -0.0061, -0.0169, -0.0178, -0.0144, -0.0001, -0.0114,  0.0047, -0.0002,\n",
      "        -0.0025, -0.0030, -0.0265, -0.0005], device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.00808637/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.1766, device='cuda:1'), 0.9, 0.75)\n",
      "=====> Optimized weights: tensor([ 0.2993, -0.2953, -0.2856,  0.2935, -0.2882, -0.2801, -0.2941,  0.2980,\n",
      "        -0.2922, -0.2945, -0.2928, -0.2963, -0.2859, -0.2968,  0.3012, -0.2858,\n",
      "        -0.2924, -0.2441, -0.2843, -0.2493], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 1.0, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 1.8512e-04, -6.6166e-02,  1.5534e-02,  5.1020e-03,  2.6367e-02,\n",
      "         2.8669e-03,  5.3377e-04,  2.0050e-03,  6.8194e-04, -5.7524e-02,\n",
      "         1.8813e-02, -7.0304e-02,  6.8038e-03,  7.8296e-04,  1.6332e-04,\n",
      "         3.9460e-03, -5.3215e-02, -3.9742e-02,  8.2193e-05,  2.8339e-04],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.00117576/1.0000000\n",
      "grad_weights: tensor([ 1.0270e-04, -3.4235e-02,  9.8981e-03,  3.5799e-03,  2.0217e-02,\n",
      "         2.0634e-03,  2.5232e-04,  1.5130e-03,  5.3655e-04, -3.4367e-02,\n",
      "         1.3884e-02, -4.4966e-02,  5.5413e-03,  5.4689e-04,  1.1535e-04,\n",
      "         2.9587e-03, -2.9588e-02, -2.6078e-02,  3.7341e-05,  2.1438e-04],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.00429005/1.0000000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> Optimized acc: (tensor(-0.6000, device='cuda:1'), 0.8, 0.6)\n",
      "=====> Optimized weights: tensor([-4.9046,  4.9091, -4.9795, -5.0065, -5.0292, -5.0124, -4.8652, -5.0231,\n",
      "        -5.0272,  4.9593, -5.0202,  4.9809, -5.0411, -4.9995, -4.9765, -5.0229,\n",
      "         4.9348,  4.9886, -4.7941, -5.0075], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 3.1236e-02, -1.1318e-03,  9.2867e-05,  1.0588e-02,  5.6705e-03,\n",
      "         2.5156e-03,  1.9476e-04,  5.9630e-05,  3.6157e-02,  7.8195e-02,\n",
      "         1.1274e-02,  1.0084e-02,  1.0786e-02,  2.1713e-04,  8.1683e-02,\n",
      "        -1.7361e-02, -1.6133e-02,  6.6590e-03,  1.2168e-02,  3.6677e-02],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.01428736/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5993, device='cuda:1'), 0.7, 0.3333333333333333)\n",
      "=====> Optimized weights: tensor([-0.9444,  0.9436, -0.9344, -0.9444, -0.9443, -0.9441, -0.9396, -0.9289,\n",
      "        -0.9444, -0.9445, -0.9444, -0.9444, -0.9444, -0.9401, -0.9445,  0.9444,\n",
      "         0.9444, -0.9443, -0.9444, -0.9444], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.6, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.00387424/1.0000000\n",
      "grad_weights: tensor([ 0.1695, -0.0294,  0.1114, -0.0084, -0.0277, -0.0031,  0.2217, -0.0020,\n",
      "        -0.0358, -0.0060, -0.0429, -0.0711, -0.0008, -0.0218, -0.0018, -0.0692,\n",
      "        -0.0076, -0.1584, -0.0058, -0.0115], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.00126644/1.0000000\n",
      "grad_weights: tensor([-0.0572,  0.0081, -0.0460,  0.0012,  0.0045,  0.0007, -0.0562,  0.0003,\n",
      "         0.0105,  0.0011,  0.0107,  0.0234,  0.0002,  0.0060,  0.0003,  0.0122,\n",
      "         0.0015,  0.0314,  0.0016,  0.0031], device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.00957599/1.0000000\n",
      "=====> Optimized acc: (tensor(0.4139, device='cuda:1'), 0.8, 0.7647058823529411)\n",
      "=====> Optimized weights: tensor([-0.6421,  0.6655, -0.6139,  0.7160,  0.7085,  0.6889, -0.6743,  0.7029,\n",
      "         0.6591,  0.6987,  0.6755,  0.6454,  0.6861,  0.6651,  0.7061,  0.7035,\n",
      "         0.6953,  0.6954,  0.6680,  0.6688], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909]\n",
      "=====> init acc: (tensor(0.3000, device='cuda:1'), 0.7, 0.65)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00700583/1.0000000\n",
      "grad_weights: tensor([ 0.0147,  0.0192,  0.0021, -0.1274,  0.0012,  0.0017,  0.0176, -0.0695,\n",
      "        -0.0899,  0.0115,  0.0014,  0.0852,  0.0074,  0.1861,  0.0082,  0.0018,\n",
      "         0.0111,  0.0486,  0.0069, -0.3148], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00123637/1.0000000\n",
      "grad_weights: tensor([ 0.0028,  0.0037,  0.0004, -0.0231,  0.0002,  0.0003,  0.0036, -0.0140,\n",
      "        -0.0166,  0.0020,  0.0003,  0.0170,  0.0014,  0.0360,  0.0015,  0.0004,\n",
      "         0.0022,  0.0094,  0.0013, -0.0608], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.00194170/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.2992, device='cuda:1'), 0.7, 0.5)\n",
      "=====> Optimized weights: tensor([-1.5604, -1.5597, -1.5546,  1.5549, -1.5452, -1.5544, -1.5675,  1.5654,\n",
      "         1.5568, -1.5527, -1.5579, -1.5643, -1.5583, -1.5614, -1.5584, -1.5597,\n",
      "        -1.5615, -1.5615, -1.5602,  1.5611], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909, 587, 741, 383, 961]\n",
      "reset tmp model\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 1.2142e-01,  2.0881e-03, -5.5822e-02,  4.1528e-03,  6.6752e-04,\n",
      "         3.5792e-02,  5.6181e-03,  7.1219e-04,  5.7632e-03,  1.4574e-02,\n",
      "         1.2630e-03,  7.0039e-03,  2.4246e-03,  2.1161e-03,  1.1406e-04,\n",
      "         3.3807e-04, -2.7962e-02,  5.7879e-03,  2.3654e-03, -7.7905e-03],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.00119013/1.0000000\n",
      "grad_weights: tensor([ 9.9656e-02,  1.4626e-03, -3.8405e-02,  3.0627e-03,  5.6706e-04,\n",
      "         3.6230e-02,  4.8417e-03,  6.4028e-04,  4.5992e-03,  1.1598e-02,\n",
      "         8.1979e-04,  5.4038e-03,  2.1708e-03,  1.6703e-03,  9.2693e-05,\n",
      "         2.1500e-04, -1.8043e-02,  4.6943e-03,  1.9966e-03, -5.6767e-03],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.01304342/0.9900000\n",
      "=====> Optimized acc: (tensor(-0.4998, device='cuda:1'), 0.9, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-4.7921, -4.7552,  4.7530, -4.7690, -4.7904, -4.8166, -4.7992, -4.7990,\n",
      "        -4.7860, -4.7860, -4.7330, -4.7794, -4.8034, -4.7824, -4.7467, -4.7159,\n",
      "         4.7352, -4.7891, -4.7947,  4.7667], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909, 587, 741, 383, 961, 993, 507, 567, 866]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.9, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.01075053/1.0000000\n",
      "grad_weights: tensor([ 0.0008,  0.0768,  0.0164,  0.4228,  0.0369,  0.0109, -0.3081,  0.0214,\n",
      "         0.0604,  0.0388, -0.0901,  0.0245,  0.0990,  0.0007,  0.0602,  0.0980,\n",
      "         0.5603,  0.0083, -0.0204, -0.4387], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00124032/1.0000000\n",
      "grad_weights: tensor([ 0.0002,  0.0171,  0.0037,  0.0943,  0.0081,  0.0025, -0.0664,  0.0050,\n",
      "         0.0137,  0.0088, -0.0202,  0.0055,  0.0226,  0.0002,  0.0143,  0.0225,\n",
      "         0.1198,  0.0018, -0.0044, -0.0929], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00122966/1.0000000\n",
      "grad_weights: tensor([ 0.0002,  0.0165,  0.0036,  0.0925,  0.0079,  0.0024, -0.0628,  0.0048,\n",
      "         0.0135,  0.0085, -0.0193,  0.0053,  0.0220,  0.0002,  0.0138,  0.0218,\n",
      "         0.1155,  0.0017, -0.0041, -0.0879], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00122030/1.0000000\n",
      "grad_weights: tensor([ 0.0002,  0.0160,  0.0035,  0.0908,  0.0078,  0.0023, -0.0597,  0.0046,\n",
      "         0.0135,  0.0082, -0.0184,  0.0051,  0.0215,  0.0002,  0.0134,  0.0212,\n",
      "         0.1116,  0.0016, -0.0039, -0.0834], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00121175/1.0000000\n",
      "grad_weights: tensor([ 0.0002,  0.0155,  0.0034,  0.0889,  0.0076,  0.0023, -0.0567,  0.0044,\n",
      "         0.0132,  0.0080, -0.0176,  0.0050,  0.0209,  0.0002,  0.0130,  0.0206,\n",
      "         0.1078,  0.0016, -0.0038, -0.0793], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00120379/1.0000000\n",
      "grad_weights: tensor([ 0.0002,  0.0151,  0.0033,  0.0870,  0.0074,  0.0022, -0.0539,  0.0042,\n",
      "         0.0130,  0.0077, -0.0169,  0.0048,  0.0204,  0.0002,  0.0127,  0.0200,\n",
      "         0.1042,  0.0015, -0.0036, -0.0752], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.00119631/1.0000000\n",
      "grad_weights: tensor([ 0.0002,  0.0146,  0.0032,  0.0849,  0.0072,  0.0022, -0.0512,  0.0040,\n",
      "         0.0127,  0.0075, -0.0162,  0.0046,  0.0199,  0.0001,  0.0123,  0.0194,\n",
      "         0.1004,  0.0014, -0.0034, -0.0714], device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.01373534/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6056, device='cuda:1'), 0.6, 0.5)\n",
      "=====> Optimized weights: tensor([-1.3903, -1.3743, -1.3792, -1.3827, -1.3764, -1.3839,  1.3514, -1.3847,\n",
      "        -1.3933, -1.3798,  1.3694, -1.3753, -1.3875, -1.4173, -1.3983, -1.3870,\n",
      "        -1.3586, -1.3571,  1.3508,  1.3450], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909, 587, 741, 383, 961, 993, 507, 567, 866, 484, 816, 254, 47]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.00252111/1.0000000\n",
      "grad_weights: tensor([-3.8983e-03, -1.8335e-02, -8.0001e-03, -3.4622e-03, -2.8424e-02,\n",
      "        -8.5095e-03, -7.5664e-03, -1.4034e-03, -7.5184e-03, -3.3234e-04,\n",
      "         1.2323e-02, -8.2564e-03, -3.3940e-04, -7.1040e-05, -6.4630e-03,\n",
      "        -1.1314e-02, -1.3937e-03,  1.2354e-02, -1.3651e-03, -7.7773e-03],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.00130395/1.0000000\n",
      "grad_weights: tensor([ 9.1136e-03,  2.6959e-02,  2.2144e-02,  5.4062e-03,  1.1451e-01,\n",
      "         3.5893e-02,  9.2463e-03,  1.6699e-03,  1.5901e-02,  8.6303e-04,\n",
      "        -4.3678e-02,  1.0256e-02,  3.8634e-04,  1.1346e-04,  1.0894e-02,\n",
      "         3.0321e-02,  1.2965e-03, -3.6105e-02,  1.3399e-03,  1.2273e-02],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.00128006/1.0000000\n",
      "grad_weights: tensor([ 9.1004e-03,  2.5292e-02,  2.1562e-02,  5.2127e-03,  1.0906e-01,\n",
      "         3.5273e-02,  8.6832e-03,  1.7144e-03,  1.5188e-02,  8.2580e-04,\n",
      "        -4.0181e-02,  9.7077e-03,  3.6639e-04,  1.0796e-04,  1.0313e-02,\n",
      "         2.9399e-02,  1.2407e-03, -3.2787e-02,  1.2642e-03,  1.1632e-02],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.00123986/1.0000000\n",
      "grad_weights: tensor([ 8.8851e-03,  2.2417e-02,  2.0338e-02,  4.8443e-03,  9.9590e-02,\n",
      "         3.3806e-02,  7.7065e-03,  1.7444e-03,  1.3982e-02,  7.6423e-04,\n",
      "        -3.4985e-02,  8.7465e-03,  3.2984e-04,  9.8194e-05,  9.3413e-03,\n",
      "         2.7558e-02,  1.1306e-03, -2.7859e-02,  1.1333e-03,  1.0555e-02],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.00347034/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6388, device='cuda:1'), 0.8, 0.75)\n",
      "=====> Optimized weights: tensor([-1.1598, -0.5860, -1.2895, -0.6899, -1.5200, -1.5551, -0.3101, -0.3456,\n",
      "        -1.0397, -1.2309,  1.4332, -0.3434, -0.2039, -0.7077, -0.7757, -1.2621,\n",
      "         0.1343,  1.2956,  0.0524, -0.6916], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909, 587, 741, 383, 961, 993, 507, 567, 866, 484, 816, 254, 47, 921, 445, 406, 134]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.9, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.00125076/1.0000000\n",
      "grad_weights: tensor([ 2.5064e-02,  5.1715e-05,  2.5381e-02,  1.4307e-02,  4.1493e-02,\n",
      "        -1.3248e-01,  1.6143e-02,  1.3533e-01,  2.6500e-02,  4.2858e-02,\n",
      "        -3.9803e-02,  2.1413e-02,  2.8027e-02,  1.5457e-04,  1.8134e-04,\n",
      "         7.8243e-05,  1.8102e-04,  1.4661e-02,  5.2344e-02,  1.5339e-04],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.00235480/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.4993, device='cuda:1'), 0.7, 0.5)\n",
      "=====> Optimized weights: tensor([-0.4670, -0.4582, -0.4670, -0.4670, -0.4670,  0.4670, -0.4670, -0.4670,\n",
      "        -0.4670, -0.4670,  0.4670, -0.4670, -0.4670, -0.4640, -0.4645, -0.4611,\n",
      "        -0.4644, -0.4670, -0.4670, -0.4640], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909, 587, 741, 383, 961, 993, 507, 567, 866, 484, 816, 254, 47, 921, 445, 406, 134, 255, 455, 86, 323]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.00125041/1.0000000\n",
      "grad_weights: tensor([ 0.0003,  0.0267,  0.0047,  0.0018,  0.0009,  0.0204,  0.0237,  0.0011,\n",
      "         0.0023,  0.0092, -0.0540,  0.0004, -0.0425, -0.0270,  0.0003,  0.0006,\n",
      "         0.0256,  0.0002,  0.0454,  0.0155], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.00317858/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5999, device='cuda:1'), 0.8, 0.6666666666666666)\n",
      "=====> Optimized weights: tensor([-2.1165, -2.1244, -2.1240, -2.1232, -2.1220, -2.1243, -2.1244, -2.1225,\n",
      "        -2.1235, -2.1242,  2.1244, -2.1190,  2.1244,  2.1244, -2.1171, -2.1212,\n",
      "        -2.1244, -2.1159, -2.1244, -2.1243], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909, 587, 741, 383, 961, 993, 507, 567, 866, 484, 816, 254, 47, 921, 445, 406, 134, 255, 455, 86, 323, 931, 190, 621, 927]\n",
      "=====> init acc: (tensor(1., device='cuda:1'), 1.0, 1.0)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.00859096/1.0000000\n",
      "grad_weights: tensor([ 2.5059e-02,  1.5219e-02,  2.5431e-04, -3.8043e-01,  1.5170e-01,\n",
      "         1.7372e-02,  3.1275e-03,  2.7313e-01, -1.6516e-01,  1.0007e-01,\n",
      "         5.3612e-03, -6.8822e-02,  2.6832e-03,  4.4632e-03,  6.0313e-02,\n",
      "         2.9996e-02,  1.4752e-01,  3.1653e-03,  1.7608e-02,  1.9256e-03],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.00124364/1.0000000\n",
      "grad_weights: tensor([ 2.6614e-03,  1.6881e-03,  2.7409e-05, -4.6067e-02,  1.8509e-02,\n",
      "         2.0077e-03,  3.3570e-04,  3.2721e-02, -2.1527e-02,  1.2356e-02,\n",
      "         6.4742e-04, -8.6300e-03,  2.8498e-04,  5.1899e-04,  7.4056e-03,\n",
      "         3.7382e-03,  1.9897e-02,  3.2518e-04,  2.1024e-03,  1.8087e-04],\n",
      "       device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.00123604/1.0000000\n",
      "grad_weights: tensor([ 2.5304e-03,  1.6445e-03,  2.6556e-05, -4.4299e-02,  1.8410e-02,\n",
      "         1.9918e-03,  3.2455e-04,  3.2334e-02, -2.0822e-02,  1.2025e-02,\n",
      "         6.2981e-04, -8.2543e-03,  2.7303e-04,  5.0149e-04,  7.3115e-03,\n",
      "         3.6907e-03,  1.9453e-02,  3.1388e-04,  2.0710e-03,  1.7278e-04],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.00288068/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6981, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-1.3526, -1.3579, -1.3478,  1.3673, -1.3694, -1.3631, -1.3537, -1.3671,\n",
      "         1.3763, -1.3700, -1.3671,  1.3712, -1.3522, -1.3625, -1.3699, -1.3716,\n",
      "        -1.3809, -1.3492, -1.3665, -1.3398], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909, 587, 741, 383, 961, 993, 507, 567, 866, 484, 816, 254, 47, 921, 445, 406, 134, 255, 455, 86, 323, 931, 190, 621, 927, 79, 433, 972, 652]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "randomMask\n",
      "AugLoss\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.00721854/1.0000000\n",
      "grad_weights: tensor([ 0.0518,  0.1001,  0.0148,  0.0195,  0.3318,  0.0512,  0.1468,  0.0595,\n",
      "         0.1319,  0.0085,  0.0065,  0.1136,  0.1560, -0.7897,  0.1394, -0.1448,\n",
      "         0.0988,  0.0022,  0.0157,  0.0395], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.00124757/1.0000000\n",
      "grad_weights: tensor([ 0.0076,  0.0176,  0.0022,  0.0030,  0.0518,  0.0082,  0.0221,  0.0094,\n",
      "         0.0206,  0.0012,  0.0009,  0.0183,  0.0248, -0.1250,  0.0227, -0.0227,\n",
      "         0.0162,  0.0003,  0.0025,  0.0060], device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.00124262/1.0000000\n",
      "grad_weights: tensor([ 0.0075,  0.0173,  0.0022,  0.0030,  0.0512,  0.0081,  0.0217,  0.0094,\n",
      "         0.0204,  0.0012,  0.0009,  0.0181,  0.0245, -0.1217,  0.0223, -0.0222,\n",
      "         0.0160,  0.0003,  0.0025,  0.0059], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.00275444/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.5999, device='cuda:1'), 0.8, 0.5)\n",
      "=====> Optimized weights: tensor([-0.4117, -0.4194, -0.4131, -0.4139, -0.4143, -0.4154, -0.4127, -0.4150,\n",
      "        -0.4143, -0.4107, -0.4109, -0.4157, -0.4150,  0.4147, -0.4160,  0.4144,\n",
      "        -0.4163, -0.4112, -0.4153, -0.4130], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909, 587, 741, 383, 961, 993, 507, 567, 866, 484, 816, 254, 47, 921, 445, 406, 134, 255, 455, 86, 323, 931, 190, 621, 927, 79, 433, 972, 652, 117, 863, 935, 430]\n",
      "=====> init acc: (tensor(0.9000, device='cuda:1'), 1.0, 0.95)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "adversarial_aug\n",
      "AugLoss\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.00125407/1.0000000\n",
      "grad_weights: tensor([ 0.0001, -0.0121,  0.0258,  0.0018,  0.0004,  0.0031,  0.0004,  0.0030,\n",
      "         0.0008, -0.0578,  0.0081,  0.0011,  0.0003,  0.0010,  0.0002,  0.0113,\n",
      "         0.0097,  0.0095,  0.0020, -0.0579], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.00117095/1.0000000\n",
      "grad_weights: tensor([ 6.9047e-05, -5.8937e-03,  2.2042e-02,  1.4925e-03,  2.7227e-04,\n",
      "         1.8226e-03,  2.5093e-04,  2.2990e-03,  5.3477e-04, -3.0663e-02,\n",
      "         5.5926e-03,  8.6077e-04,  2.0060e-04,  5.1579e-04,  9.1422e-05,\n",
      "         9.6432e-03,  7.4165e-03,  1.0108e-02,  1.1949e-03, -2.5735e-02],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.00584762/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.6034, device='cuda:1'), 1.0, 1.0)\n",
      "=====> Optimized weights: tensor([-9.4176,  9.4987, -9.8152, -9.7898, -9.7460, -9.6291, -9.6985, -9.7684,\n",
      "        -9.7260,  9.5582, -9.7235, -9.7735, -9.6274, -9.5218, -9.5724, -9.8131,\n",
      "        -9.7739, -9.8550, -9.6233,  9.4294], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909, 587, 741, 383, 961, 993, 507, 567, 866, 484, 816, 254, 47, 921, 445, 406, 134, 255, 455, 86, 323, 931, 190, 621, 927, 79, 433, 972, 652, 117, 863, 935, 430, 76, 187, 435, 814]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.8, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.00219938/1.0000000\n",
      "grad_weights: tensor([-6.5275e-03, -9.5689e-03, -9.5549e-05, -2.1958e-04, -2.4656e-03,\n",
      "        -2.7427e-03, -2.1507e-03,  8.7301e-02, -1.1622e-03, -4.6408e-03,\n",
      "        -1.1146e-03, -2.4425e-03, -4.2873e-02,  4.0888e-02, -4.3608e-02,\n",
      "        -1.7589e-02, -2.1122e-02,  8.5297e-03, -6.9580e-03, -2.5163e-02],\n",
      "       device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.00494401/1.0000000\n",
      "=====> Optimized acc: (tensor(0.5997, device='cuda:1'), 0.9, 0.8823529411764706)\n",
      "=====> Optimized weights: tensor([ 1.5318,  1.5318,  1.5161,  1.5250,  1.5314,  1.5314,  1.5313, -1.5320,\n",
      "         1.5307,  1.5317,  1.5306,  1.5314,  1.5320, -1.5320,  1.5320,  1.5319,\n",
      "         1.5319, -1.5318,  1.5318,  1.5319], device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909, 587, 741, 383, 961, 993, 507, 567, 866, 484, 816, 254, 47, 921, 445, 406, 134, 255, 455, 86, 323, 931, 190, 621, 927, 79, 433, 972, 652, 117, 863, 935, 430, 76, 187, 435, 814, 516, 999, 1006, 659]\n",
      "=====> init acc: (tensor(-1., device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([ 0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000,\n",
      "         0.0000,  0.0000,  0.0000,  0.0000,  0.0000, -7.1846, -7.3151, -7.3115,\n",
      "        -7.3557, -7.2437, -7.2898, -7.3605], device='cuda:1')\n",
      "gaussian_aug\n",
      "AugLoss\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.00120441/1.0000000\n",
      "grad_weights: tensor([-0.1199,  0.0915,  0.0228, -0.0189,  0.0019,  0.0006,  0.0012,  0.0004,\n",
      "         0.0006,  0.0031, -0.0262, -0.0326,  0.0263,  0.0002,  0.0088,  0.0001,\n",
      "         0.0460,  0.0096,  0.0011,  0.0024], device='cuda:1')\n",
      "randomReplace\n",
      "AugLoss\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.00898575/1.0000000\n",
      "=====> Optimized acc: (tensor(-0.8337, device='cuda:1'), 0.7, 0.5)\n",
      "=====> Optimized weights: tensor([  3.1761,  -3.1760,  -3.1759,   3.1759,  -3.1744,  -3.1704,  -3.1735,\n",
      "         -3.1677,  -3.1707,  -3.1751,   3.1760,   3.1760,  -3.1760, -10.3462,\n",
      "        -10.4908, -10.4664, -10.5317, -10.4194, -10.4630, -10.5353],\n",
      "       device='cuda:1')\n",
      "valid_idxs: [402, 704, 142, 663, 51, 949, 403, 639, 336, 783, 285, 893, 276, 1007, 310, 124, 28, 1019, 953, 138, 683, 963, 821, 728, 785, 568, 707, 440, 695, 912, 786, 891, 1005, 898, 374, 247, 75, 233, 1036, 279, 441, 113, 196, 24, 988, 731, 10, 711, 159, 42, 1017, 0, 48, 834, 87, 242, 126, 338, 1002, 191, 640, 353, 524, 633, 272, 93, 1000, 764, 678, 588, 303, 491, 439, 825, 658, 153, 91, 429, 529, 14, 265, 211, 43, 321, 5, 715, 192, 221, 618, 946, 779, 539, 148, 225, 228, 692, 472, 297, 298, 828, 476, 329, 250, 636, 495, 320, 350, 307, 421, 99, 851, 1040, 727, 291, 835, 777, 83, 70, 1012, 260, 289, 424, 154, 496, 1004, 535, 854, 983, 797, 346, 509, 922, 98, 521, 613, 342, 976, 537, 332, 26, 951, 129, 426, 641, 493, 982, 411, 941, 756, 183, 677, 925, 240, 465, 501, 909, 587, 741, 383, 961, 993, 507, 567, 866, 484, 816, 254, 47, 921, 445, 406, 134, 255, 455, 86, 323, 931, 190, 621, 927, 79, 433, 972, 652, 117, 863, 935, 430, 76, 187, 435, 814, 516, 999, 1006, 659, 467, 27, 713, 609]\n",
      "reset tmp model\n",
      "%3d | %3d Post-MetaTrain Performance of model1: (0.800575263662512, (array([0.82627579, 0.60655738]), array([0.94066749, 0.31623932]), array([0.87976879, 0.41573034]), array([809, 234])))\n",
      "###Accuracy On selected instancees (0.735, (array([0.84042553, 0.64150943]), array([0.67521368, 0.81927711]), array([0.74881517, 0.71957672]), array([117,  83])))\n",
      "###Accuracy On pseaudo instances (0.98, (array([0.98, 0.  ]), array([1., 0.]), array([0.98989899, 0.        ]), array([49,  1])))\n",
      "###Accuracy On training instances (0.784, (array([0.88888889, 0.64150943]), array([0.77108434, 0.80952381]), array([0.82580645, 0.71578947]), array([166,  84])))\n",
      "==================Global Data Selection===============>\n",
      "###Accuracy On selected instancees (0.7355769230769231, (array([0.82905983, 0.61538462]), array([0.73484848, 0.73684211]), array([0.77911647, 0.67065868]), array([132,  76])))\n",
      "###Accuracy On pseaudo instances (0.98, (array([0.98, 0.  ]), array([1., 0.]), array([0.98989899, 0.        ]), array([49,  1])))\n",
      "###Accuracy On training instances (0.7829457364341085, (array([0.8742515 , 0.61538462]), array([0.80662983, 0.72727273]), array([0.83908046, 0.66666667]), array([181,  77])))\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/sklearn/metrics/classification.py:1437: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n"
     ]
    }
   ],
   "source": [
    "    entrophy, preds, logits = WeakLabeling(anno_model, weak_set, pseaudo_idxs=p_idxs + e_idxs)\n",
    "    idxs = expandPseaudoSet(tr_model, anno_model, weak_set, p_idxs + e_idxs, threshold=0.95)\n",
    "    p_idxs.extend(idxs)\n",
    "    trainer = MetaSelfTrainer(tr_model, weak_set, f_set, weak_set_label,\n",
    "                                 exp_idxs=e_idxs, convey_fn=None, lr4model=5e-2,\n",
    "                                   scale_lr4model=4e-2, max_few_shot_size=100, batch_size=20)\n",
    "    max_meta_steps = 10\n",
    "    if len(e_idxs)>100:\n",
    "        print(\"expand_idxs length:\", len(e_idxs))\n",
    "        trainer.ConstructExpandData(batch_size=100)\n",
    "        max_meta_steps = 5\n",
    "    # valid_idxs = trainer.BalancedTraining(entrophy, max_epoch=10, batch_size=32,\n",
    "    #                                             max_meta_steps=max_meta_steps,\n",
    "    #                                                 lr4weights=0.1, meta_lr4model=2e-2,\n",
    "    #                                                     meta_scale_lr4model=2e-3,\n",
    "    #                                                         pseaudo_idxs=p_idxs)\n",
    "    tmp = (trainer.lr4model, trainer.scale_lr4model)\n",
    "    trainer.lr4model, trainer.scale_lr4model = 2e-1, 1e-4\n",
    "    valid_idxs = trainer.PopOut(max_epochs=1, max_meta_steps=max_meta_steps,\n",
    "                                    lr4weights=0.02, pseaudo_idxs=pseaudo_idxs,\n",
    "                                        pop_ratio=0.2) # ferguson 上是0.1, sydney上是0.05\n",
    "    trainer.lr4model, trainer.scale_lr4model = tmp[0], tmp[1]\n",
    "    rst_model1 = Perf(tr_model, weak_set, weak_set_label)\n",
    "    print(\"%3d | %3d Post-MetaTrain Performance of model1:\", rst_model1)\n",
    "    pseaudo_labels = torch.tensor(weak_set.data_y).argmax(dim=1)\n",
    "    rst_s = acc_P_R_F1(weak_set_label[valid_idxs],\n",
    "                    pseaudo_labels[valid_idxs])\n",
    "    print(\"###Accuracy On selected instancees\", rst_s)\n",
    "    rst_p = acc_P_R_F1(weak_set_label[p_idxs],\n",
    "                       pseaudo_labels[p_idxs])\n",
    "    print(\"###Accuracy On pseaudo instances\", rst_p)\n",
    "    rst_t = acc_P_R_F1(weak_set_label[p_idxs + valid_idxs],\n",
    "                       pseaudo_labels[p_idxs + valid_idxs])\n",
    "    print(\"###Accuracy On training instances\", rst_t)\n",
    "\n",
    "    print(\"==================Global Data Selection===============>\")\n",
    "    valid_cnt = len(trainer.weak_set_weights)//5\n",
    "    valid_idxs = trainer.weak_set_weights.argsort()[-valid_cnt:].tolist()\n",
    "    rst_s = acc_P_R_F1(weak_set_label[valid_idxs],\n",
    "                       pseaudo_labels[valid_idxs])\n",
    "    print(\"###Accuracy On selected instancees\", rst_s)\n",
    "    rst_p = acc_P_R_F1(weak_set_label[p_idxs],\n",
    "                       pseaudo_labels[p_idxs])\n",
    "    print(\"###Accuracy On pseaudo instances\", rst_p)\n",
    "    rst_t = acc_P_R_F1(weak_set_label[p_idxs + valid_idxs],\n",
    "                       pseaudo_labels[p_idxs + valid_idxs])\n",
    "    print(\"###Accuracy On training instances\", rst_t)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "#### 人工生成的元验证集的效果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "from Dataloader.dataloader_utils import Sample_data, Merge_data, Lemma_Factory\n",
    "from Dataloader.twitterloader import TwitterSet, BiGCNTwitterSet\n",
    "from SentModel.Sent2Vec import TFIDFBasedVec, W2VRDMVec\n",
    "from PropModel.GraphPropagation import BiGCN\n",
    "from RumdetecFramework.GraphRumorDect import BiGCNRumorDetec\n",
    "from RumdetecFramework.BaseRumorFramework import RumorDetection\n",
    "from RumdetecFramework.InstanceReweighting import MetaEvaluator, WeightedAcc\n",
    "from sklearn.feature_extraction.text import TfidfVectorizer\n",
    "from sklearn.metrics import accuracy_score, precision_score, \\\n",
    "            recall_score, f1_score,precision_recall_fscore_support\n",
    "import pickle\n",
    "import torch\n",
    "import torch.nn as nn\n",
    "import random\n",
    "import torch.nn.functional as F\n",
    "import os\n",
    "import gc\n",
    "import fitlog\n",
    "from tqdm import trange"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "def dataset2Vecs(model, dataset, batch_size=20):\n",
    "    vec_list, label_list= [], []\n",
    "    with torch.no_grad():\n",
    "        for i in trange(0, len(dataset), batch_size):\n",
    "            batch = dataset.collate_raw_batch([dataset[j] for j in range(i, min(i+20, len(dataset)), 1)])\n",
    "            vecs = model.Batch2Vecs(batch)\n",
    "            label_list.append(batch[-1])\n",
    "            vec_list.append(vecs)\n",
    "        vecTensor = torch.cat(vec_list, dim=0)\n",
    "        labelTensor = torch.cat(label_list,dim=0)\n",
    "    return vecTensor, labelTensor\n",
    "\n",
    "def InstanceContrastiveInference(model, dataset, batch_size=20):\n",
    "    vecTensor, domain_label = dataset2Vecs(model, dataset, batch_size=batch_size)\n",
    "    cosine = torch.matmul(vecTensor, vecTensor.T) / torch.matmul(vecTensor.norm(dim=1).unsqueeze(-1),\n",
    "                                                         vecTensor.norm(dim=1).unsqueeze(0))\n",
    "    domain_label = domain_label + 1\n",
    "    mtx = torch.matmul(domain_label.unsqueeze(1), domain_label.unsqueeze(0))/\\\n",
    "                (domain_label*domain_label).unsqueeze(1)\n",
    "    eq_mtx = mtx.__eq__(1).float()\n",
    "    coeff_mtx = eq_mtx + (eq_mtx - 1) - torch.eye(len(eq_mtx))\n",
    "    return (cosine*coeff_mtx.to(cosine.device)).sum()/2.0\n",
    "\n",
    "def InferPerf(model, query_set, support_set, batch_size=20):\n",
    "    vec_query, label_query = dataset2Vecs(model, query_set, batch_size=batch_size)\n",
    "    vec_support, label_support = dataset2Vecs(model, support_set, batch_size=batch_size)\n",
    "    with open(\"InferPerfEnv.pkl\", \"wb\") as fb:\n",
    "        pickle.dump((vec_query, vec_support, label_query, label_support),\n",
    "                    fb, protocol=pickle.HIGHEST_PROTOCOL)\n",
    "    cosine = torch.matmul(vec_query, vec_support.T) / torch.matmul(vec_query.norm(dim=1).unsqueeze(-1),\n",
    "                                                                   vec_support.norm(dim=1).unsqueeze(0))\n",
    "    votes = cosine.__gt__(0).int().sum(dim=1)\n",
    "    votes = votes/(len(support_set)*1.0)\n",
    "    selected_label = label_query[votes.__gt__(0.5)]\n",
    "    print(\"Inference Performance:\", acc_P_R_F1(torch.ones_like(selected_label)*domain_ID, selected_label))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "t_domain = Merge_data(few_shot_set, new_domain)\n",
    "vecT, _ = dataset2Vecs(model1, t_domain, batch_size=32)\n",
    "vecS, _ = dataset2Vecs(model1, old_domain, batch_size=32)\n",
    "norm_mtx = torch.matmul(vecS.norm(dim=1).unsqueeze(-1),\n",
    "                        vecT.norm(dim=1).unsqueeze(0)) \\\n",
    "            + torch.ones([len(vecS), len(vecT)], device=vecS.device)*1e-8\n",
    "cosine = torch.matmul(vecS, vecT.T)/norm_mtx　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　\n",
    "votes = cosine.__gt__(0.7).int().sum(dim=1)\n",
    "source_idxs = votes.argsort()[-100:]\n",
    "selected_set = old_domain.select(source_idxs.cpu().tolist())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(selected_set)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "tr_model, anno_model, f_set, weak_set, weak_set_label, p_idxs, e_idxs = \\\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.\n",
      "  warnings.warn(warning.format(ret))\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot   0 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.3317, -0.0208, -0.0972,  0.7246, -0.0877, -1.2929, -0.0217, -3.7667,\n",
      "        -0.0107, -0.1490, -0.0083, -3.4833, -0.0253, -0.0142, -0.0419, -0.2670,\n",
      "        -0.3727, -1.1110, -0.0058, -0.0133], device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.17658226/0.9400000\n",
      "grad_weights: tensor([-0.3234, -0.0204, -0.0952,  0.7170, -0.0858, -1.2663, -0.0213, -3.6776,\n",
      "        -0.0105, -0.1463, -0.0081, -3.4241, -0.0246, -0.0139, -0.0409, -0.2613,\n",
      "        -0.3594, -1.0753, -0.0056, -0.0130], device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.17645068/0.9400000\n",
      "grad_weights: tensor([-0.3152, -0.0200, -0.0932,  0.7093, -0.0840, -1.2399, -0.0209, -3.5890,\n",
      "        -0.0103, -0.1436, -0.0080, -3.3652, -0.0239, -0.0136, -0.0399, -0.2556,\n",
      "        -0.3465, -1.0513, -0.0055, -0.0127], device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.17632152/0.9400000\n",
      "grad_weights: tensor([-0.3072, -0.0196, -0.0912,  0.7014, -0.0822, -1.2137, -0.0204, -3.5006,\n",
      "        -0.0101, -0.1410, -0.0078, -3.3066, -0.0233, -0.0133, -0.0389, -0.2500,\n",
      "        -0.3340, -1.0171, -0.0053, -0.0124], device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.17619488/0.9400000\n",
      "grad_weights: tensor([-0.2994, -0.0192, -0.0892,  0.6935, -0.0804, -1.1878, -0.0200, -3.4127,\n",
      "        -0.0099, -0.1383, -0.0076, -3.2484, -0.0226, -0.0130, -0.0380, -0.2445,\n",
      "        -0.3219, -0.9838, -0.0052, -0.0121], device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.17607084/0.9400000\n",
      "grad_weights: tensor([-0.2913, -0.0187, -0.0872,  0.6853, -0.0785, -1.1611, -0.0196, -3.3199,\n",
      "        -0.0097, -0.1357, -0.0075, -3.1873, -0.0220, -0.0127, -0.0370, -0.2388,\n",
      "        -0.3098, -0.9505, -0.0051, -0.0117], device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.17594945/0.9400000\n",
      "grad_weights: tensor([-0.2837, -0.0184, -0.0852,  0.6773, -0.0768, -1.1358, -0.0192, -3.2330,\n",
      "        -0.0095, -0.1331, -0.0073, -3.1298, -0.0214, -0.0124, -0.0361, -0.2334,\n",
      "        -0.2985, -0.9191, -0.0049, -0.0115], device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.17583063/0.9400000\n",
      "grad_weights: tensor([-0.2763, -0.0180, -0.0833,  0.6691, -0.0750, -1.1108, -0.0188, -3.1466,\n",
      "        -0.0093, -0.1306, -0.0071, -3.0727, -0.0207, -0.0121, -0.0352, -0.2281,\n",
      "        -0.2875, -0.8885, -0.0048, -0.0112], device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.17571448/0.9500000\n",
      "grad_weights: tensor([-0.2690, -0.0176, -0.0814,  0.6608, -0.0732, -1.0850, -0.0184, -3.0547,\n",
      "        -0.0091, -0.1279, -0.0070, -3.0159, -0.0202, -0.0118, -0.0343, -0.2228,\n",
      "        -0.2766, -0.8589, -0.0047, -0.0109], device='cuda:1')\n",
      "####Few Shot   0 | 993 ####, loss/acc = 0.17560105/0.9500000\n",
      "grad_weights: tensor([-0.2618, -0.0172, -0.0795,  0.6525, -0.0714, -1.0607, -0.0180, -2.9695,\n",
      "        -0.0089, -0.1254, -0.0068, -2.9597, -0.0196, -0.0115, -0.0334, -0.2177,\n",
      "        -0.2663, -0.8302, -0.0045, -0.0106], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.3994, device='cuda:1'), 0.8, 0.7368421052631579)\n",
      "=====> Optimized weights: tensor([ 1.1298,  1.1321,  1.1316, -1.1361,  1.1315,  1.1318,  1.1321,  1.1300,\n",
      "         1.1323,  1.1330,  1.1314,  1.1334,  1.1287,  1.1311,  1.1303,  1.1314,\n",
      "         1.1246,  1.1272,  1.1292,  1.1303], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444]\n",
      "=====> init acc: (tensor(0.2000, device='cuda:1'), 0.7, 0.6)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([ 1.6984e+00, -1.5709e+00, -2.5975e-01, -1.9568e-01, -2.1404e-01,\n",
      "        -2.6031e+00, -8.4628e-02, -2.8175e+00, -4.5809e-01, -1.3310e+00,\n",
      "        -3.4857e-01, -1.9504e-01, -6.0398e-02, -2.4693e-03, -1.2633e-02,\n",
      "        -5.3629e-01, -1.4835e+00, -2.8103e-02, -3.4684e-03, -3.1655e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.17665143/0.9400000\n",
      "grad_weights: tensor([ 1.6913e+00, -1.5583e+00, -2.5732e-01, -1.9397e-01, -2.1225e-01,\n",
      "        -2.5827e+00, -8.3751e-02, -2.7971e+00, -4.5306e-01, -1.3190e+00,\n",
      "        -3.4487e-01, -1.9300e-01, -5.9769e-02, -2.4481e-03, -1.2540e-02,\n",
      "        -5.3165e-01, -1.4705e+00, -2.7873e-02, -3.4350e-03, -3.1345e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.17658712/0.9400000\n",
      "grad_weights: tensor([ 1.6842e+00, -1.5457e+00, -2.5490e-01, -1.9228e-01, -2.1047e-01,\n",
      "        -2.5624e+00, -8.2879e-02, -2.7768e+00, -4.4807e-01, -1.3070e+00,\n",
      "        -3.4121e-01, -1.9097e-01, -5.9145e-02, -2.4271e-03, -1.2448e-02,\n",
      "        -5.2703e-01, -1.4576e+00, -2.7645e-02, -3.4021e-03, -3.1039e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.17652330/0.9400000\n",
      "grad_weights: tensor([ 1.6770e+00, -1.5332e+00, -2.5250e-01, -1.9059e-01, -2.0869e-01,\n",
      "        -2.5421e+00, -8.2011e-02, -2.7565e+00, -4.4312e-01, -1.2951e+00,\n",
      "        -3.3756e-01, -1.8895e-01, -5.8524e-02, -2.4060e-03, -1.2355e-02,\n",
      "        -5.2241e-01, -1.4447e+00, -2.7416e-02, -3.3688e-03, -3.0732e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.17645991/0.9400000\n",
      "grad_weights: tensor([ 1.6698e+00, -1.5207e+00, -2.5012e-01, -1.8892e-01, -2.0693e-01,\n",
      "        -2.5220e+00, -8.1148e-02, -2.7364e+00, -4.3823e-01, -1.2834e+00,\n",
      "        -3.3397e-01, -1.8696e-01, -5.7910e-02, -2.3850e-03, -1.2263e-02,\n",
      "        -5.1783e-01, -1.4319e+00, -2.7189e-02, -3.3360e-03, -3.0427e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.17639700/0.9400000\n",
      "grad_weights: tensor([ 1.6625e+00, -1.5082e+00, -2.4773e-01, -1.8724e-01, -2.0517e-01,\n",
      "        -2.5019e+00, -8.0290e-02, -2.7162e+00, -4.3336e-01, -1.2716e+00,\n",
      "        -3.3038e-01, -1.8497e-01, -5.7297e-02, -2.3638e-03, -1.2170e-02,\n",
      "        -5.1324e-01, -1.4191e+00, -2.6960e-02, -3.3028e-03, -3.0121e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.17633457/0.9400000\n",
      "grad_weights: tensor([ 1.6551e+00, -1.4958e+00, -2.4537e-01, -1.8558e-01, -2.0342e-01,\n",
      "        -2.4817e+00, -7.9437e-02, -2.6960e+00, -4.2853e-01, -1.2599e+00,\n",
      "        -3.2682e-01, -1.8300e-01, -5.6689e-02, -2.3428e-03, -1.2077e-02,\n",
      "        -5.0867e-01, -1.4064e+00, -2.6732e-02, -3.2697e-03, -2.9816e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.17627262/0.9400000\n",
      "grad_weights: tensor([ 1.6478e+00, -1.4834e+00, -2.4302e-01, -1.8393e-01, -2.0168e-01,\n",
      "        -2.4618e+00, -7.8597e-02, -2.6761e+00, -4.2378e-01, -1.2483e+00,\n",
      "        -3.2333e-01, -1.8106e-01, -5.6089e-02, -2.3220e-03, -1.1986e-02,\n",
      "        -5.0414e-01, -1.3938e+00, -2.6513e-02, -3.2368e-03, -2.9516e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.17621118/0.9400000\n",
      "grad_weights: tensor([ 1.6403e+00, -1.4706e+00, -2.4061e-01, -1.8223e-01, -1.9989e-01,\n",
      "        -2.4412e+00, -7.7735e-02, -2.6553e+00, -4.1892e-01, -1.2364e+00,\n",
      "        -3.1974e-01, -1.7906e-01, -5.5475e-02, -2.3005e-03, -1.1891e-02,\n",
      "        -4.9960e-01, -1.3808e+00, -2.6281e-02, -3.2025e-03, -2.9205e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot  20 | 993 ####, loss/acc = 0.17615028/0.9400000\n",
      "grad_weights: tensor([ 1.6328e+00, -1.4582e+00, -2.3829e-01, -1.8059e-01, -1.9816e-01,\n",
      "        -2.4213e+00, -7.6899e-02, -2.6352e+00, -4.1422e-01, -1.2249e+00,\n",
      "        -3.1627e-01, -1.7714e-01, -5.4880e-02, -2.2798e-03, -1.1800e-02,\n",
      "        -4.9508e-01, -1.3682e+00, -2.6056e-02, -3.1697e-03, -2.8904e-03],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.0998, device='cuda:1'), 0.5, 0.5789473684210527)\n",
      "=====> Optimized weights: tensor([-0.4665,  0.4659,  0.4657,  0.4658,  0.4659,  0.4660,  0.4655,  0.4661,\n",
      "         0.4654,  0.4658,  0.4655,  0.4655,  0.4655,  0.4656,  0.4660,  0.4658,\n",
      "         0.4658,  0.4659,  0.4655,  0.4655], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.7, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-2.1882, -0.1213, -1.7888, -0.6368, -0.0611, -0.7886,  0.6147, -1.2158,\n",
      "        -0.0326, -0.2307, -0.5715, -0.0574, -0.0242, -0.4547, -0.0939, -0.0278,\n",
      "        -0.0092, -1.4613, -0.1784, -0.0465], device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot  40 | 993 ####, loss/acc = 0.17665695/0.9400000\n",
      "grad_weights: tensor([-2.1654, -0.1204, -1.7742, -0.6311, -0.0607, -0.7821,  0.6123, -1.2061,\n",
      "        -0.0323, -0.2285, -0.5652, -0.0570, -0.0240, -0.4509, -0.0931, -0.0275,\n",
      "        -0.0091, -1.4483, -0.1766, -0.0462], device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.17659809/0.9400000\n",
      "grad_weights: tensor([-2.1427, -0.1195, -1.7595, -0.6254, -0.0602, -0.7757,  0.6098, -1.1963,\n",
      "        -0.0320, -0.2262, -0.5590, -0.0565, -0.0237, -0.4471, -0.0922, -0.0272,\n",
      "        -0.0090, -1.4353, -0.1749, -0.0459], device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.17653961/0.9400000\n",
      "grad_weights: tensor([-2.1202, -0.1186, -1.7449, -0.6197, -0.0598, -0.7693,  0.6073, -1.1866,\n",
      "        -0.0317, -0.2240, -0.5528, -0.0560, -0.0234, -0.4433, -0.0914, -0.0269,\n",
      "        -0.0089, -1.4224, -0.1731, -0.0455], device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.17648153/0.9400000\n",
      "grad_weights: tensor([-2.0979, -0.1177, -1.7304, -0.6140, -0.0594, -0.7629,  0.6048, -1.1769,\n",
      "        -0.0314, -0.2218, -0.5466, -0.0555, -0.0232, -0.4396, -0.0906, -0.0266,\n",
      "        -0.0089, -1.4096, -0.1714, -0.0452], device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.17642391/0.9400000\n",
      "grad_weights: tensor([-2.0756, -0.1167, -1.7158, -0.6084, -0.0590, -0.7565,  0.6023, -1.1672,\n",
      "        -0.0311, -0.2196, -0.5405, -0.0550, -0.0229, -0.4358, -0.0897, -0.0263,\n",
      "        -0.0088, -1.3968, -0.1697, -0.0448], device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.17636666/0.9400000\n",
      "grad_weights: tensor([-2.0536, -0.1158, -1.7014, -0.6028, -0.0585, -0.7502,  0.5998, -1.1575,\n",
      "        -0.0308, -0.2174, -0.5344, -0.0545, -0.0227, -0.4321, -0.0889, -0.0260,\n",
      "        -0.0087, -1.3841, -0.1680, -0.0445], device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.17630988/0.9400000\n",
      "grad_weights: tensor([-2.0313, -0.1149, -1.6866, -0.5970, -0.0581, -0.7437,  0.5971, -1.1476,\n",
      "        -0.0305, -0.2152, -0.5281, -0.0540, -0.0224, -0.4283, -0.0881, -0.0257,\n",
      "        -0.0086, -1.3711, -0.1662, -0.0441], device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.17625359/0.9400000\n",
      "grad_weights: tensor([-2.0080, -0.1139, -1.6708, -0.5915, -0.0577, -0.7375,  0.5946, -1.1380,\n",
      "        -0.0302, -0.2131, -0.5221, -0.0535, -0.0222, -0.4246, -0.0872, -0.0254,\n",
      "        -0.0085, -1.3586, -0.1646, -0.0438], device='cuda:1')\n",
      "####Few Shot  40 | 993 ####, loss/acc = 0.17619772/0.9400000\n",
      "grad_weights: tensor([-1.9865, -0.1130, -1.6565, -0.5860, -0.0573, -0.7312,  0.5920, -1.1285,\n",
      "        -0.0299, -0.2109, -0.5161, -0.0530, -0.0219, -0.4210, -0.0864, -0.0251,\n",
      "        -0.0085, -1.3461, -0.1629, -0.0435], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.5001, device='cuda:1'), 0.7, 0.7368421052631579)\n",
      "=====> Optimized weights: tensor([ 0.5586,  0.5592,  0.5591,  0.5589,  0.5593,  0.5591, -0.5599,  0.5591,\n",
      "         0.5589,  0.5588,  0.5585,  0.5590,  0.5585,  0.5590,  0.5589,  0.5585,\n",
      "         0.5589,  0.5589,  0.5587,  0.5592], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-7.5285e-02, -1.8472e-01, -1.1680e+00, -1.4132e+00, -7.2225e-03,\n",
      "        -1.0298e-01, -6.8570e-01, -1.3099e-01, -6.1250e-01, -1.7374e-02,\n",
      "        -7.4337e-03, -1.5543e-02, -1.8644e-01, -2.1082e-03, -2.1982e-01,\n",
      "        -1.0767e-02, -4.8027e-01,  2.6889e+00, -1.7218e+00, -2.8754e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.17666215/0.9400000\n",
      "grad_weights: tensor([-7.4755e-02, -1.8329e-01, -1.1597e+00, -1.4008e+00, -7.1655e-03,\n",
      "        -1.0207e-01, -6.7775e-01, -1.2988e-01, -6.0814e-01, -1.7203e-02,\n",
      "        -7.3610e-03, -1.5415e-02, -1.8499e-01, -2.0911e-03, -2.1797e-01,\n",
      "        -1.0670e-02, -4.7558e-01,  2.6799e+00, -1.7081e+00, -2.8452e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.17660847/0.9400000\n",
      "grad_weights: tensor([-7.4227e-02, -1.8186e-01, -1.1513e+00, -1.3883e+00, -7.1088e-03,\n",
      "        -1.0117e-01, -6.6984e-01, -1.2877e-01, -6.0380e-01, -1.7032e-02,\n",
      "        -7.2890e-03, -1.5288e-02, -1.8354e-01, -2.0740e-03, -2.1614e-01,\n",
      "        -1.0572e-02, -4.7092e-01,  2.6708e+00, -1.6944e+00, -2.8152e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.17655514/0.9400000\n",
      "grad_weights: tensor([-7.3698e-02, -1.8043e-01, -1.1430e+00, -1.3757e+00, -7.0520e-03,\n",
      "        -1.0027e-01, -6.6197e-01, -1.2766e-01, -5.9945e-01, -1.6863e-02,\n",
      "        -7.2166e-03, -1.5161e-02, -1.8209e-01, -2.0570e-03, -2.1429e-01,\n",
      "        -1.0475e-02, -4.6629e-01,  2.6617e+00, -1.6808e+00, -2.7850e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.17650224/0.9400000\n",
      "grad_weights: tensor([-7.3171e-02, -1.7902e-01, -1.1348e+00, -1.3634e+00, -6.9962e-03,\n",
      "        -9.9376e-02, -6.5419e-01, -1.2657e-01, -5.9518e-01, -1.6695e-02,\n",
      "        -7.1455e-03, -1.5035e-02, -1.8065e-01, -2.0402e-03, -2.1245e-01,\n",
      "        -1.0379e-02, -4.6171e-01,  2.6526e+00, -1.6674e+00, -2.7554e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.17644969/0.9400000\n",
      "grad_weights: tensor([-7.2645e-02, -1.7760e-01, -1.1266e+00, -1.3509e+00, -6.9399e-03,\n",
      "        -9.8485e-02, -6.4642e-01, -1.2547e-01, -5.9086e-01, -1.6528e-02,\n",
      "        -7.0734e-03, -1.4909e-02, -1.7921e-01, -2.0232e-03, -2.1061e-01,\n",
      "        -1.0283e-02, -4.5716e-01,  2.6433e+00, -1.6539e+00, -2.7253e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.17639758/0.9400000\n",
      "grad_weights: tensor([-7.2120e-02, -1.7618e-01, -1.1184e+00, -1.3385e+00, -6.8834e-03,\n",
      "        -9.7598e-02, -6.3870e-01, -1.2437e-01, -5.8654e-01, -1.6363e-02,\n",
      "        -7.0014e-03, -1.4783e-02, -1.7777e-01, -2.0063e-03, -2.0876e-01,\n",
      "        -1.0187e-02, -4.5263e-01,  2.6340e+00, -1.6404e+00, -2.6953e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.17634581/0.9400000\n",
      "grad_weights: tensor([-7.1596e-02, -1.7476e-01, -1.1102e+00, -1.3260e+00, -6.8273e-03,\n",
      "        -9.6716e-02, -6.3104e-01, -1.2328e-01, -5.8223e-01, -1.6198e-02,\n",
      "        -6.9668e-03, -1.4658e-02, -1.7633e-01, -1.9895e-03, -2.0693e-01,\n",
      "        -1.0091e-02, -4.4812e-01,  2.6247e+00, -1.6270e+00, -2.6654e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.17629445/0.9400000\n",
      "grad_weights: tensor([-7.1079e-02, -1.7336e-01, -1.1021e+00, -1.3136e+00, -6.7731e-03,\n",
      "        -9.5844e-02, -6.2344e-01, -1.2221e-01, -5.7795e-01, -1.6036e-02,\n",
      "        -6.8956e-03, -1.4535e-02, -1.7490e-01, -1.9729e-03, -2.0511e-01,\n",
      "        -9.9972e-03, -4.4368e-01,  2.6154e+00, -1.6138e+00, -2.6366e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot  60 | 993 ####, loss/acc = 0.17624357/0.9400000\n",
      "grad_weights: tensor([-7.0559e-02, -1.7194e-01, -1.0939e+00, -1.3012e+00, -6.7174e-03,\n",
      "        -9.4973e-02, -6.1588e-01, -1.2113e-01, -5.7367e-01, -1.5874e-02,\n",
      "        -6.8241e-03, -1.4411e-02, -1.7347e-01, -1.9562e-03, -2.0329e-01,\n",
      "        -9.9026e-03, -4.3924e-01,  2.6059e+00, -1.6005e+00, -2.6067e-01],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.4000, device='cuda:1'), 0.9, 0.7368421052631579)\n",
      "=====> Optimized weights: tensor([ 0.5401,  0.5399,  0.5400,  0.5397,  0.5398,  0.5397,  0.5392,  0.5398,\n",
      "         0.5401,  0.5395,  0.5395,  0.5398,  0.5399,  0.5396,  0.5398,  0.5396,\n",
      "         0.5396, -0.5407,  0.5399,  0.5394], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.9, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.0187, -0.1005, -0.5700, -4.4501, -0.0452, -0.7075, -0.0126, -1.4440,\n",
      "        -0.0061, -0.0873, -0.0911, -2.2511, -0.5553, -0.4495, -0.3228, -0.0390,\n",
      "        -0.0587, -3.4049, -0.8597, -0.0049], device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.17656340/0.9400000\n",
      "grad_weights: tensor([-0.0183, -0.0987, -0.5590, -4.3580, -0.0443, -0.6933, -0.0123, -1.4096,\n",
      "        -0.0060, -0.0855, -0.0894, -2.1992, -0.5443, -0.4386, -0.3162, -0.0381,\n",
      "        -0.0573, -3.3286, -0.8348, -0.0048], device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot  80 | 993 ####, loss/acc = 0.17641312/0.9400000\n",
      "grad_weights: tensor([-0.0179, -0.0970, -0.5480, -4.3239, -0.0434, -0.6792, -0.0121, -1.3757,\n",
      "        -0.0058, -0.0837, -0.0876, -2.1480, -0.5333, -0.4277, -0.3097, -0.0372,\n",
      "        -0.0560, -3.2533, -0.8104, -0.0046], device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.17626552/0.9400000\n",
      "grad_weights: tensor([-0.0176, -0.0952, -0.5370, -4.2323, -0.0425, -0.6652, -0.0118, -1.3422,\n",
      "        -0.0057, -0.0820, -0.0859, -2.0974, -0.5225, -0.4169, -0.3032, -0.0364,\n",
      "        -0.0546, -3.1788, -0.7862, -0.0045], device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.17612055/0.9400000\n",
      "grad_weights: tensor([-0.0172, -0.0935, -0.5263, -4.1419, -0.0416, -0.6513, -0.0115, -1.3094,\n",
      "        -0.0056, -0.0802, -0.0842, -2.0475, -0.5117, -0.4062, -0.2968, -0.0355,\n",
      "        -0.0533, -3.1056, -0.7626, -0.0044], device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.17597832/0.9400000\n",
      "grad_weights: tensor([-0.0169, -0.0918, -0.5155, -4.0523, -0.0408, -0.6375, -0.0113, -1.2770,\n",
      "        -0.0054, -0.0785, -0.0825, -1.9982, -0.5010, -0.3955, -0.2905, -0.0347,\n",
      "        -0.0520, -3.0331, -0.7392, -0.0043], device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.17583893/0.9400000\n",
      "grad_weights: tensor([-0.0165, -0.0901, -0.5044, -3.9598, -0.0398, -0.6230, -0.0110, -1.2447,\n",
      "        -0.0053, -0.0768, -0.0807, -1.9462, -0.4903, -0.3846, -0.2837, -0.0339,\n",
      "        -0.0507, -2.9587, -0.7150, -0.0042], device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.17570248/0.9400000\n",
      "grad_weights: tensor([-0.0162, -0.0884, -0.4938, -3.8723, -0.0390, -0.6096, -0.0107, -1.2135,\n",
      "        -0.0051, -0.0751, -0.0791, -1.8983, -0.4798, -0.3740, -0.2775, -0.0331,\n",
      "        -0.0494, -2.8883, -0.6925, -0.0041], device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.17556883/0.9500000\n",
      "grad_weights: tensor([-0.0158, -0.0867, -0.4833, -3.7858, -0.0381, -0.5961, -0.0105, -1.1827,\n",
      "        -0.0050, -0.0734, -0.0774, -1.8512, -0.4694, -0.3636, -0.2713, -0.0323,\n",
      "        -0.0482, -2.8189, -0.6704, -0.0040], device='cuda:1')\n",
      "####Few Shot  80 | 993 ####, loss/acc = 0.17543812/0.9500000\n",
      "grad_weights: tensor([-0.0155, -0.0851, -0.4730, -3.7004, -0.0373, -0.5827, -0.0102, -1.1525,\n",
      "        -0.0049, -0.0718, -0.0758, -1.8064, -0.4591, -0.3533, -0.2651, -0.0315,\n",
      "        -0.0469, -2.7505, -0.6486, -0.0039], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.5002, device='cuda:1'), 0.8, 0.75)\n",
      "=====> Optimized weights: tensor([0.9880, 0.9888, 0.9880, 0.9884, 0.9878, 0.9877, 0.9869, 0.9863, 0.9862,\n",
      "        0.9876, 0.9881, 0.9866, 0.9879, 0.9858, 0.9876, 0.9869, 0.9864, 0.9869,\n",
      "        0.9839, 0.9861], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.9, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-1.5479e-01, -1.7494e-01, -4.0125e-02, -9.9346e-02, -6.0050e-02,\n",
      "        -1.8771e-01, -1.1435e-01, -6.2081e-03, -7.7887e-03, -2.5327e-02,\n",
      "        -6.3401e-01, -2.0893e-03, -1.0625e-01, -2.2502e+00, -2.9449e-01,\n",
      "        -2.2680e-01, -1.7823e-01, -1.1975e-01, -1.4241e-02, -1.0063e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.17667118/0.9400000\n",
      "grad_weights: tensor([-1.5344e-01, -1.7323e-01, -3.9863e-02, -9.8689e-02, -5.9687e-02,\n",
      "        -1.8677e-01, -1.1364e-01, -6.1575e-03, -7.7298e-03, -2.5149e-02,\n",
      "        -6.2914e-01, -2.0756e-03, -1.0569e-01, -2.2315e+00, -2.9182e-01,\n",
      "        -2.2495e-01, -1.7716e-01, -1.1892e-01, -1.4130e-02, -1.0004e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.17662640/0.9400000\n",
      "grad_weights: tensor([-1.5210e-01, -1.7153e-01, -3.9602e-02, -9.8035e-02, -5.9324e-02,\n",
      "        -1.8567e-01, -1.1294e-01, -6.1059e-03, -7.6711e-03, -2.4971e-02,\n",
      "        -6.2429e-01, -2.0622e-03, -1.0513e-01, -2.2127e+00, -2.8917e-01,\n",
      "        -2.2313e-01, -1.7611e-01, -1.1810e-01, -1.4018e-02, -9.9456e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.17658181/0.9400000\n",
      "grad_weights: tensor([-1.5077e-01, -1.6984e-01, -3.9341e-02, -9.7382e-02, -5.8959e-02,\n",
      "        -1.8457e-01, -1.1223e-01, -6.0549e-03, -7.6121e-03, -2.4793e-02,\n",
      "        -6.1944e-01, -2.0488e-03, -1.0457e-01, -2.1941e+00, -2.8653e-01,\n",
      "        -2.2129e-01, -1.7505e-01, -1.1727e-01, -1.3906e-02, -9.8869e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.17653757/0.9400000\n",
      "grad_weights: tensor([-1.4944e-01, -1.6817e-01, -3.9081e-02, -9.6730e-02, -5.8596e-02,\n",
      "        -1.8342e-01, -1.1153e-01, -6.0045e-03, -7.5538e-03, -2.4617e-02,\n",
      "        -6.1461e-01, -2.0353e-03, -1.0401e-01, -2.1756e+00, -2.8391e-01,\n",
      "        -2.1943e-01, -1.7399e-01, -1.1644e-01, -1.3794e-02, -9.8283e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.17649350/0.9400000\n",
      "grad_weights: tensor([-1.4813e-01, -1.6651e-01, -3.8822e-02, -9.6086e-02, -5.8232e-02,\n",
      "        -1.8232e-01, -1.1083e-01, -5.9542e-03, -7.4960e-03, -2.4441e-02,\n",
      "        -6.0982e-01, -2.0218e-03, -1.0345e-01, -2.1572e+00, -2.8133e-01,\n",
      "        -2.1760e-01, -1.7294e-01, -1.1562e-01, -1.3682e-02, -9.7702e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.17644976/0.9400000\n",
      "grad_weights: tensor([-1.4682e-01, -1.6487e-01, -3.8564e-02, -9.5441e-02, -5.7871e-02,\n",
      "        -1.8123e-01, -1.1013e-01, -5.9045e-03, -7.4382e-03, -2.4267e-02,\n",
      "        -6.0504e-01, -2.0084e-03, -1.0289e-01, -2.1389e+00, -2.7875e-01,\n",
      "        -2.1577e-01, -1.7190e-01, -1.1480e-01, -1.3571e-02, -9.7120e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.17640625/0.9400000\n",
      "grad_weights: tensor([-1.4552e-01, -1.6324e-01, -3.8308e-02, -9.4799e-02, -5.7509e-02,\n",
      "        -1.8014e-01, -1.0943e-01, -5.8549e-03, -7.3805e-03, -2.4093e-02,\n",
      "        -6.0027e-01, -1.9953e-03, -1.0233e-01, -2.1207e+00, -2.7620e-01,\n",
      "        -2.1395e-01, -1.7086e-01, -1.1399e-01, -1.3461e-02, -9.6541e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.17636307/0.9400000\n",
      "grad_weights: tensor([-1.4423e-01, -1.6163e-01, -3.8053e-02, -9.4159e-02, -5.7148e-02,\n",
      "        -1.7905e-01, -1.0874e-01, -5.8054e-03, -7.3234e-03, -2.3920e-02,\n",
      "        -5.9553e-01, -1.9819e-03, -1.0178e-01, -2.1026e+00, -2.7367e-01,\n",
      "        -2.1212e-01, -1.6982e-01, -1.1318e-01, -1.3350e-02, -9.5964e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 100 | 993 ####, loss/acc = 0.17632014/0.9400000\n",
      "grad_weights: tensor([-1.4295e-01, -1.6003e-01, -3.7797e-02, -9.3521e-02, -5.6787e-02,\n",
      "        -1.7795e-01, -1.0804e-01, -5.7568e-03, -7.2663e-03, -2.3748e-02,\n",
      "        -5.9081e-01, -1.9686e-03, -1.0122e-01, -2.0847e+00, -2.7115e-01,\n",
      "        -2.1029e-01, -1.6878e-01, -1.1237e-01, -1.3240e-02, -9.5386e-02],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> Optimized weights: tensor([0.9384, 0.9380, 0.9391, 0.9390, 0.9392, 0.9393, 0.9392, 0.9384, 0.9386,\n",
      "        0.9389, 0.9387, 0.9386, 0.9395, 0.9385, 0.9382, 0.9385, 0.9393, 0.9389,\n",
      "        0.9385, 0.9393], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-1.5422e+00, -4.1375e-01,  1.5825e-01, -3.0748e-02, -1.8131e+01,\n",
      "         1.6382e+00, -1.5623e-02, -1.0268e+00, -6.2312e-01, -1.5344e+00,\n",
      "        -8.7754e-03, -2.3623e-02, -1.0018e-02, -5.4180e-02, -8.6230e-03,\n",
      "         1.3206e+00, -3.2374e-02, -1.0252e-01, -7.1440e-02, -7.1468e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.17634836/0.9400000\n",
      "grad_weights: tensor([-1.4543e+00, -3.9415e-01,  1.5121e-01, -2.9304e-02, -1.7269e+01,\n",
      "         1.6297e+00, -1.4841e-02, -9.6662e-01, -5.9182e-01, -1.4596e+00,\n",
      "        -8.2836e-03, -2.2348e-02, -9.3273e-03, -5.1894e-02, -8.1385e-03,\n",
      "         1.2618e+00, -3.0503e-02, -9.5431e-02, -6.7785e-02, -6.7875e-02],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 120 | 993 ####, loss/acc = 0.17599602/0.9400000\n",
      "grad_weights: tensor([-1.3682e+00, -3.7468e-01,  1.4397e-01, -2.7872e-02, -1.6396e+01,\n",
      "         1.6174e+00, -1.4063e-02, -9.0606e-01, -5.6087e-01, -1.3844e+00,\n",
      "        -7.8048e-03, -2.1086e-02, -8.6398e-03, -4.9620e-02, -7.6691e-03,\n",
      "         1.2018e+00, -2.8688e-02, -8.8632e-02, -6.4143e-02, -6.4228e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.17565951/0.9500000\n",
      "grad_weights: tensor([-1.2859e+00, -3.5589e-01,  1.3680e-01, -2.6451e-02, -1.5549e+01,\n",
      "         1.6035e+00, -1.3297e-02, -8.4795e-01, -5.3070e-01, -1.3116e+00,\n",
      "        -7.3428e-03, -1.9872e-02, -7.9593e-03, -4.7375e-02, -7.2175e-03,\n",
      "         1.1428e+00, -2.6945e-02, -8.2265e-02, -6.0652e-02, -6.0722e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.17533895/0.9500000\n",
      "grad_weights: tensor([-1.2061e+00, -3.3739e-01,  1.2956e-01, -2.5044e-02, -1.4705e+01,\n",
      "         1.5861e+00, -1.2539e-02, -7.9091e-01, -5.0078e-01, -1.2391e+00,\n",
      "        -6.8962e-03, -1.8690e-02, -7.2883e-03, -4.5157e-02, -6.7818e-03,\n",
      "         1.0834e+00, -2.5265e-02, -7.6223e-02, -5.7209e-02, -5.7207e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.17503458/0.9500000\n",
      "grad_weights: tensor([-1.1297e+00, -3.1947e-01,  1.2227e-01, -2.3655e-02, -1.3881e+01,\n",
      "         1.5666e+00, -1.1795e-02, -7.3508e-01, -4.7170e-01, -1.1682e+00,\n",
      "        -6.4654e-03, -1.7541e-02, -6.6248e-03, -4.2969e-02, -6.3655e-03,\n",
      "         1.0246e+00, -2.3651e-02, -7.0550e-02, -5.3874e-02, -5.3783e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.17474650/0.9500000\n",
      "grad_weights: tensor([-1.0559e+00, -3.0190e-01,  1.1491e-01, -2.2277e-02, -1.3066e+01,\n",
      "         1.5435e+00, -1.1057e-02, -6.8039e-01, -4.4306e-01, -1.0985e+00,\n",
      "        -6.0477e-03, -1.6419e-02, -5.9687e-03, -4.0798e-02, -5.9643e-03,\n",
      "         9.6553e-01, -2.2095e-02, -6.5184e-02, -5.0610e-02, -5.0394e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.17447473/0.9500000\n",
      "grad_weights: tensor([-9.8538e-01, -2.8489e-01,  1.0756e-01, -2.0923e-02, -1.2273e+01,\n",
      "         1.5180e+00, -1.0335e-02, -6.2707e-01, -4.1524e-01, -1.0302e+00,\n",
      "        -5.6472e-03, -1.5337e-02, -5.3234e-03, -3.8673e-02, -5.5824e-03,\n",
      "         9.0705e-01, -2.0608e-02, -6.0152e-02, -4.7446e-02, -4.7068e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.17421938/0.9500000\n",
      "grad_weights: tensor([-9.1814e-01, -2.6850e-01,  1.0024e-01, -1.9594e-02, -1.1504e+01,\n",
      "         1.4902e+00, -9.6255e-03, -5.7578e-01, -3.8835e-01, -9.6382e-01,\n",
      "        -5.2598e-03, -1.4295e-02, -4.6882e-03, -3.6594e-02, -5.2190e-03,\n",
      "         8.4925e-01, -1.9195e-02, -5.5447e-02, -4.4392e-02, -4.3793e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 120 | 993 ####, loss/acc = 0.17398009/0.9500000\n",
      "grad_weights: tensor([-8.5367e-01, -2.5255e-01,  9.2955e-02, -1.8294e-02, -1.0753e+01,\n",
      "         1.4592e+00, -8.9343e-03, -5.2513e-01, -3.6206e-01, -8.9884e-01,\n",
      "        -4.8922e-03, -1.3286e-02, -4.0682e-03, -3.4556e-02, -4.8719e-03,\n",
      "         7.9188e-01, -1.7833e-02, -5.1029e-02, -4.1429e-02, -4.0611e-02],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.6979, device='cuda:1'), 0.8, 0.8823529411764706)\n",
      "=====> Optimized weights: tensor([ 1.3624,  1.3696, -1.3685,  1.3685,  1.3680, -1.3940,  1.3658,  1.3581,\n",
      "         1.3665,  1.3672,  1.3629,  1.3640,  1.3440,  1.3729,  1.3635, -1.3694,\n",
      "         1.3620,  1.3538,  1.3662,  1.3654], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([ 2.6608e+00, -1.8909e-03, -1.2723e+00, -1.6258e+00, -2.3882e+00,\n",
      "        -1.6620e+00, -4.3766e-02, -3.5282e-02, -4.1176e-02, -1.1201e+00,\n",
      "        -1.2332e-02, -7.4317e-02, -5.8297e-01, -4.4244e-02, -3.2092e-01,\n",
      "        -5.3160e-01, -1.3192e+00, -4.7022e-02, -3.2786e-01,  1.0508e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.17667007/0.9400000\n",
      "grad_weights: tensor([ 2.6471e+00, -1.8789e-03, -1.2640e+00, -1.6152e+00, -2.3745e+00,\n",
      "        -1.6522e+00, -4.3500e-02, -3.4975e-02, -4.0874e-02, -1.1123e+00,\n",
      "        -1.2253e-02, -7.3759e-02, -5.7828e-01, -4.3895e-02, -3.1848e-01,\n",
      "        -5.2676e-01, -1.3107e+00, -4.6688e-02, -3.2531e-01,  1.0445e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.17662418/0.9400000\n",
      "grad_weights: tensor([ 2.6335e+00, -1.8673e-03, -1.2557e+00, -1.6047e+00, -2.3608e+00,\n",
      "        -1.6425e+00, -4.3235e-02, -3.4671e-02, -4.0574e-02, -1.1046e+00,\n",
      "        -1.2175e-02, -7.3206e-02, -5.7364e-01, -4.3549e-02, -3.1607e-01,\n",
      "        -5.2197e-01, -1.3022e+00, -4.6359e-02, -3.2277e-01,  1.0382e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.17657854/0.9400000\n",
      "grad_weights: tensor([ 2.6198e+00, -1.8552e-03, -1.2474e+00, -1.5942e+00, -2.3471e+00,\n",
      "        -1.6327e+00, -4.2970e-02, -3.4368e-02, -4.0272e-02, -1.0969e+00,\n",
      "        -1.2096e-02, -7.2653e-02, -5.6900e-01, -4.3203e-02, -3.1366e-01,\n",
      "        -5.1720e-01, -1.2938e+00, -4.6028e-02, -3.2021e-01,  1.0319e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.17653313/0.9400000\n",
      "grad_weights: tensor([ 2.6062e+00, -1.8432e-03, -1.2391e+00, -1.5837e+00, -2.3334e+00,\n",
      "        -1.6230e+00, -4.2707e-02, -3.4066e-02, -3.9974e-02, -1.0892e+00,\n",
      "        -1.2018e-02, -7.2106e-02, -5.6440e-01, -4.2860e-02, -3.1126e-01,\n",
      "        -5.1247e-01, -1.2853e+00, -4.5699e-02, -3.1766e-01,  1.0256e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.17648798/0.9400000\n",
      "grad_weights: tensor([ 2.5925e+00, -1.8314e-03, -1.2309e+00, -1.5733e+00, -2.3198e+00,\n",
      "        -1.6133e+00, -4.2443e-02, -3.3767e-02, -3.9677e-02, -1.0815e+00,\n",
      "        -1.1940e-02, -7.1558e-02, -5.5982e-01, -4.2518e-02, -3.0888e-01,\n",
      "        -5.0776e-01, -1.2769e+00, -4.5371e-02, -3.1512e-01,  1.0192e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.17644309/0.9400000\n",
      "grad_weights: tensor([ 2.5791e+00, -1.8197e-03, -1.2227e+00, -1.5629e+00, -2.3063e+00,\n",
      "        -1.6036e+00, -4.2182e-02, -3.3471e-02, -3.9383e-02, -1.0740e+00,\n",
      "        -1.1863e-02, -7.1017e-02, -5.5530e-01, -4.2181e-02, -3.0652e-01,\n",
      "        -5.0313e-01, -1.2686e+00, -4.5047e-02, -3.1265e-01,  1.0131e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.17639847/0.9400000\n",
      "grad_weights: tensor([ 2.5655e+00, -1.8078e-03, -1.2145e+00, -1.5525e+00, -2.2928e+00,\n",
      "        -1.5940e+00, -4.1921e-02, -3.3177e-02, -3.9090e-02, -1.0664e+00,\n",
      "        -1.1786e-02, -7.0478e-02, -5.5078e-01, -4.1844e-02, -3.0417e-01,\n",
      "        -4.9850e-01, -1.2603e+00, -4.4722e-02, -3.1011e-01,  1.0068e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.17635411/0.9400000\n",
      "grad_weights: tensor([ 2.5518e+00, -1.7960e-03, -1.2064e+00, -1.5422e+00, -2.2793e+00,\n",
      "        -1.5843e+00, -4.1661e-02, -3.2883e-02, -3.8797e-02, -1.0588e+00,\n",
      "        -1.1709e-02, -6.9940e-02, -5.4629e-01, -4.1510e-02, -3.0182e-01,\n",
      "        -4.9390e-01, -1.2519e+00, -4.4398e-02, -3.0758e-01,  1.0005e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 140 | 993 ####, loss/acc = 0.17631000/0.9400000\n",
      "grad_weights: tensor([ 2.5381e+00, -1.7844e-03, -1.1983e+00, -1.5319e+00, -2.2658e+00,\n",
      "        -1.5748e+00, -4.1401e-02, -3.2592e-02, -3.8507e-02, -1.0513e+00,\n",
      "        -1.1632e-02, -6.9404e-02, -5.4182e-01, -4.1176e-02, -2.9949e-01,\n",
      "        -4.8933e-01, -1.2436e+00, -4.4077e-02, -3.0505e-01,  9.9418e-01],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8333333333333334)\n",
      "=====> Optimized weights: tensor([-0.3045,  0.3042,  0.3043,  0.3043,  0.3044,  0.3044,  0.3044,  0.3041,\n",
      "         0.3042,  0.3043,  0.3043,  0.3042,  0.3042,  0.3042,  0.3042,  0.3041,\n",
      "         0.3043,  0.3043,  0.3042, -0.3044], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613]\n",
      "=====> init acc: (tensor(0.8000, device='cuda:1'), 0.9, 0.9)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 160 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-5.6136e-02, -2.4057e-01, -1.3267e-01, -4.1144e-01, -4.5844e-02,\n",
      "        -6.2713e-01, -4.2738e-04, -2.2184e+00, -3.1757e-01, -3.7711e-03,\n",
      "        -5.5682e-02, -1.0389e-01, -8.2805e-01, -1.3752e-01, -5.0268e-02,\n",
      "        -3.1702e-02, -7.2038e-02, -1.0349e+00, -3.1004e-02, -2.7355e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.17665218/0.9400000\n",
      "grad_weights: tensor([-5.5669e-02, -2.3786e-01, -1.3082e-01, -4.0774e-01, -4.5470e-02,\n",
      "        -6.2073e-01, -4.2381e-04, -2.1968e+00, -3.1491e-01, -3.7329e-03,\n",
      "        -5.5181e-02, -1.0305e-01, -8.1833e-01, -1.3618e-01, -4.9887e-02,\n",
      "        -3.1369e-02, -7.1388e-02, -1.0255e+00, -3.0743e-02, -2.7098e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.17658858/0.9400000\n",
      "grad_weights: tensor([-5.5204e-02, -2.3517e-01, -1.2898e-01, -4.0405e-01, -4.5098e-02,\n",
      "        -6.1438e-01, -4.1994e-04, -2.1754e+00, -3.1226e-01, -3.6950e-03,\n",
      "        -5.4683e-02, -1.0221e-01, -8.0867e-01, -1.3485e-01, -4.9506e-02,\n",
      "        -3.1039e-02, -7.0741e-02, -1.0161e+00, -3.0484e-02, -2.6843e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.17652546/0.9400000\n",
      "grad_weights: tensor([-5.4742e-02, -2.3251e-01, -1.2717e-01, -4.0040e-01, -4.4728e-02,\n",
      "        -6.0809e-01, -4.1639e-04, -2.1541e+00, -3.0962e-01, -3.6575e-03,\n",
      "        -5.4187e-02, -1.0138e-01, -7.9913e-01, -1.3353e-01, -4.9127e-02,\n",
      "        -3.0711e-02, -7.0099e-02, -1.0068e+00, -3.0225e-02, -2.6589e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.17646278/0.9400000\n",
      "grad_weights: tensor([-5.4279e-02, -2.2986e-01, -1.2538e-01, -3.9676e-01, -4.4358e-02,\n",
      "        -6.0185e-01, -4.1284e-04, -2.1329e+00, -3.0698e-01, -3.6197e-03,\n",
      "        -5.3691e-02, -1.0055e-01, -7.8965e-01, -1.3222e-01, -4.8747e-02,\n",
      "        -3.0384e-02, -6.9458e-02, -9.9757e-01, -2.9967e-02, -2.6335e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.17640054/0.9400000\n",
      "grad_weights: tensor([-5.3817e-02, -2.2725e-01, -1.2361e-01, -3.9314e-01, -4.3989e-02,\n",
      "        -5.9562e-01, -4.0902e-04, -2.1118e+00, -3.0435e-01, -3.5824e-03,\n",
      "        -5.3197e-02, -9.9725e-02, -7.8026e-01, -1.3091e-01, -4.8368e-02,\n",
      "        -3.0059e-02, -6.8819e-02, -9.8833e-01, -2.9709e-02, -2.6083e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.17633879/0.9400000\n",
      "grad_weights: tensor([-5.3357e-02, -2.2465e-01, -1.2186e-01, -3.8953e-01, -4.3621e-02,\n",
      "        -5.8944e-01, -4.0548e-04, -2.0909e+00, -3.0174e-01, -3.5455e-03,\n",
      "        -5.2705e-02, -9.8901e-02, -7.7095e-01, -1.2961e-01, -4.7989e-02,\n",
      "        -2.9737e-02, -6.8184e-02, -9.7914e-01, -2.9453e-02, -2.5831e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.17627755/0.9400000\n",
      "grad_weights: tensor([-5.2897e-02, -2.2208e-01, -1.2013e-01, -3.8596e-01, -4.3255e-02,\n",
      "        -5.8332e-01, -4.0195e-04, -2.0701e+00, -2.9913e-01, -3.5088e-03,\n",
      "        -5.2215e-02, -9.8081e-02, -7.6174e-01, -1.2832e-01, -4.7610e-02,\n",
      "        -2.9417e-02, -6.7553e-02, -9.7002e-01, -2.9197e-02, -2.5581e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.17621675/0.9400000\n",
      "grad_weights: tensor([-5.2444e-02, -2.1955e-01, -1.1843e-01, -3.8244e-01, -4.2898e-02,\n",
      "        -5.7726e-01, -3.9845e-04, -2.0495e+00, -2.9656e-01, -3.4728e-03,\n",
      "        -5.1731e-02, -9.7280e-02, -7.5266e-01, -1.2705e-01, -4.7237e-02,\n",
      "        -2.9102e-02, -6.6928e-02, -9.6099e-01, -2.8951e-02, -2.5333e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 160 | 993 ####, loss/acc = 0.17615648/0.9400000\n",
      "grad_weights: tensor([-5.1987e-02, -2.1702e-01, -1.1675e-01, -3.7891e-01, -4.2535e-02,\n",
      "        -5.7122e-01, -3.9493e-04, -2.0289e+00, -2.9397e-01, -3.4364e-03,\n",
      "        -5.1246e-02, -9.6465e-02, -7.4362e-01, -1.2578e-01, -4.6861e-02,\n",
      "        -2.8786e-02, -6.6304e-02, -9.5196e-01, -2.8697e-02, -2.5085e-01],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.8002, device='cuda:1'), 0.9, 0.9)\n",
      "=====> Optimized weights: tensor([0.9598, 0.9588, 0.9579, 0.9596, 0.9599, 0.9592, 0.9575, 0.9594, 0.9598,\n",
      "        0.9590, 0.9596, 0.9599, 0.9587, 0.9594, 0.9601, 0.9591, 0.9596, 0.9596,\n",
      "        0.9598, 0.9595], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.9106, -0.0512, -0.1303, -0.7367, -0.0162, -0.4131, -1.6865, -1.7642,\n",
      "        -1.0826,  2.1587, -0.4618, -3.7398, -2.3572,  0.3471, -0.6346, -9.2323,\n",
      "        -0.5795, -0.0421, -0.0865, -0.0632], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.17667060/0.9400000\n",
      "grad_weights: tensor([-0.9050, -0.0508, -0.1294, -0.7320, -0.0161, -0.4102, -1.6752, -1.7497,\n",
      "        -1.0750,  2.1544, -0.4590, -3.7187, -2.3438,  0.3451, -0.6312, -9.1709,\n",
      "        -0.5758, -0.0419, -0.0858, -0.0628], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.17662519/0.9400000\n",
      "grad_weights: tensor([-0.8993, -0.0505, -0.1285, -0.7274, -0.0160, -0.4072, -1.6640, -1.7352,\n",
      "        -1.0674,  2.1500, -0.4562, -3.6978, -2.3304,  0.3431, -0.6278, -9.1098,\n",
      "        -0.5721, -0.0416, -0.0852, -0.0624], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.17658001/0.9400000\n",
      "grad_weights: tensor([-0.8937, -0.0502, -0.1276, -0.7228, -0.0159, -0.4043, -1.6528, -1.7208,\n",
      "        -1.0598,  2.1457, -0.4534, -3.6769, -2.3172,  0.3411, -0.6244, -9.0488,\n",
      "        -0.5684, -0.0414, -0.0846, -0.0621], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.17653504/0.9400000\n",
      "grad_weights: tensor([-0.8882, -0.0498, -0.1267, -0.7181, -0.0158, -0.4013, -1.6417, -1.7065,\n",
      "        -1.0522,  2.1412, -0.4506, -3.6560, -2.3039,  0.3391, -0.6210, -8.9880,\n",
      "        -0.5647, -0.0412, -0.0839, -0.0617], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.17649032/0.9400000\n",
      "grad_weights: tensor([-0.8826, -0.0495, -0.1257, -0.7135, -0.0157, -0.3984, -1.6307, -1.6924,\n",
      "        -1.0448,  2.1369, -0.4479, -3.6353, -2.2907,  0.3371, -0.6177, -8.9279,\n",
      "        -0.5611, -0.0410, -0.0833, -0.0613], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.17644581/0.9400000\n",
      "grad_weights: tensor([-0.8771, -0.0492, -0.1248, -0.7089, -0.0156, -0.3955, -1.6196, -1.6783,\n",
      "        -1.0373,  2.1324, -0.4451, -3.6144, -2.2775,  0.3351, -0.6143, -8.8674,\n",
      "        -0.5572, -0.0407, -0.0827, -0.0610], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.17640157/0.9400000\n",
      "grad_weights: tensor([-0.8716, -0.0488, -0.1239, -0.7044, -0.0155, -0.3926, -1.6086, -1.6642,\n",
      "        -1.0299,  2.1279, -0.4423, -3.5936, -2.2643,  0.3331, -0.6110, -8.8072,\n",
      "        -0.5535, -0.0405, -0.0821, -0.0606], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.17635755/0.9400000\n",
      "grad_weights: tensor([-0.8661, -0.0485, -0.1230, -0.6998, -0.0153, -0.3897, -1.5977, -1.6503,\n",
      "        -1.0225,  2.1234, -0.4396, -3.5729, -2.2512,  0.3311, -0.6076, -8.7472,\n",
      "        -0.5499, -0.0403, -0.0815, -0.0603], device='cuda:1')\n",
      "####Few Shot 180 | 993 ####, loss/acc = 0.17631379/0.9400000\n",
      "grad_weights: tensor([-0.8606, -0.0482, -0.1221, -0.6953, -0.0152, -0.3868, -1.5868, -1.6365,\n",
      "        -1.0152,  2.1188, -0.4368, -3.5523, -2.2380,  0.3291, -0.6043, -8.6873,\n",
      "        -0.5462, -0.0400, -0.0809, -0.0599], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.3999, device='cuda:1'), 0.8, 0.7777777777777778)\n",
      "=====> Optimized weights: tensor([ 0.1722,  0.1722,  0.1721,  0.1722,  0.1722,  0.1721,  0.1722,  0.1721,\n",
      "         0.1721, -0.1724,  0.1722,  0.1722,  0.1722, -0.1722,  0.1722,  0.1722,\n",
      "         0.1722,  0.1722,  0.1721,  0.1722], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282]\n",
      "reset tmp model\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.6, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 200 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.0039, -0.0916, -0.0390, -0.8999,  0.9470, -0.1058, -0.1324, -0.2921,\n",
      "        -2.5516, -0.1089, -2.0189,  2.8081, -0.0379, -0.3480, -0.0185, -0.0421,\n",
      "        -0.0779, -1.1854, -0.1317, -0.3873], device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.17662382/0.9400000\n",
      "grad_weights: tensor([-0.0038, -0.0903, -0.0384, -0.8892,  0.9360, -0.1044, -0.1303, -0.2883,\n",
      "        -2.5152, -0.1074, -1.9911,  2.7971, -0.0374, -0.3400, -0.0183, -0.0414,\n",
      "        -0.0770, -1.1706, -0.1300, -0.3817], device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.17653245/0.9400000\n",
      "grad_weights: tensor([-0.0038, -0.0890, -0.0378, -0.8784,  0.9250, -0.1030, -0.1282, -0.2845,\n",
      "        -2.4790, -0.1059, -1.9634,  2.7857, -0.0369, -0.3321, -0.0180, -0.0408,\n",
      "        -0.0760, -1.1558, -0.1282, -0.3762], device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.17644210/0.9400000\n",
      "grad_weights: tensor([-0.0037, -0.0878, -0.0372, -0.8678,  0.9140, -0.1015, -0.1261, -0.2807,\n",
      "        -2.4433, -0.1044, -1.9360,  2.7741, -0.0364, -0.3244, -0.0177, -0.0401,\n",
      "        -0.0750, -1.1410, -0.1265, -0.3707], device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.17635278/0.9400000\n",
      "grad_weights: tensor([-0.0037, -0.0865, -0.0367, -0.8571,  0.9029, -0.1001, -0.1240, -0.2769,\n",
      "        -2.4078, -0.1029, -1.9087,  2.7622, -0.0359, -0.3168, -0.0175, -0.0394,\n",
      "        -0.0740, -1.1264, -0.1248, -0.3652], device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.17626455/0.9400000\n",
      "grad_weights: tensor([-0.0036, -0.0853, -0.0361, -0.8463,  0.8917, -0.0987, -0.1219, -0.2731,\n",
      "        -2.3720, -0.1013, -1.8811,  2.7494, -0.0354, -0.3094, -0.0172, -0.0387,\n",
      "        -0.0730, -1.1116, -0.1231, -0.3597], device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.17617737/0.9400000\n",
      "grad_weights: tensor([-0.0036, -0.0840, -0.0355, -0.8358,  0.8806, -0.0973, -0.1198, -0.2694,\n",
      "        -2.3371, -0.0999, -1.8542,  2.7369, -0.0349, -0.3021, -0.0170, -0.0381,\n",
      "        -0.0721, -1.0971, -0.1214, -0.3543], device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.17609127/0.9400000\n",
      "grad_weights: tensor([-0.0035, -0.0828, -0.0350, -0.8253,  0.8695, -0.0959, -0.1177, -0.2656,\n",
      "        -2.3026, -0.0984, -1.8275,  2.7241, -0.0345, -0.2950, -0.0167, -0.0374,\n",
      "        -0.0711, -1.0828, -0.1198, -0.3488], device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.17600627/0.9400000\n",
      "grad_weights: tensor([-0.0035, -0.0815, -0.0344, -0.8149,  0.8584, -0.0946, -0.1156, -0.2619,\n",
      "        -2.2683, -0.0969, -1.8010,  2.7110, -0.0340, -0.2881, -0.0164, -0.0368,\n",
      "        -0.0701, -1.0684, -0.1181, -0.3434], device='cuda:1')\n",
      "####Few Shot 200 | 993 ####, loss/acc = 0.17592239/0.9400000\n",
      "grad_weights: tensor([-0.0034, -0.0803, -0.0338, -0.8046,  0.8474, -0.0932, -0.1136, -0.2582,\n",
      "        -2.2344, -0.0955, -1.7730,  2.6977, -0.0335, -0.2813, -0.0162, -0.0362,\n",
      "        -0.0692, -1.0541, -0.1165, -0.3380], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.6002, device='cuda:1'), 0.9, 0.7777777777777778)\n",
      "=====> Optimized weights: tensor([ 0.7558,  0.7556,  0.7552,  0.7562, -0.7562,  0.7557,  0.7549,  0.7558,\n",
      "         0.7555,  0.7556,  0.7557, -0.7583,  0.7558,  0.7530,  0.7554,  0.7549,\n",
      "         0.7560,  0.7560,  0.7558,  0.7555], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.9, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.6936, -1.0144, -0.7841, -0.0063, -0.7412, -1.1193, -0.2415, -0.0167,\n",
      "        -0.9325, -0.5155, -0.9057, -1.6774, -0.2185, -0.1344, -0.1659, -0.0565,\n",
      "        -0.3914, -0.0075, -0.0350, -0.8333], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.17668942/0.9400000\n",
      "grad_weights: tensor([-0.6912, -1.0107, -0.7815, -0.0063, -0.7385, -1.1148, -0.2406, -0.0167,\n",
      "        -0.9284, -0.5135, -0.9017, -1.6697, -0.2175, -0.1340, -0.1653, -0.0563,\n",
      "        -0.3902, -0.0074, -0.0348, -0.8305], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.17666274/0.9400000\n",
      "grad_weights: tensor([-0.6889, -1.0071, -0.7788, -0.0063, -0.7358, -1.1104, -0.2398, -0.0166,\n",
      "        -0.9244, -0.5115, -0.8978, -1.6621, -0.2166, -0.1335, -0.1647, -0.0561,\n",
      "        -0.3889, -0.0074, -0.0347, -0.8277], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.17663616/0.9400000\n",
      "grad_weights: tensor([-0.6866, -1.0035, -0.7762, -0.0063, -0.7332, -1.1059, -0.2390, -0.0166,\n",
      "        -0.9203, -0.5095, -0.8939, -1.6545, -0.2157, -0.1330, -0.1641, -0.0559,\n",
      "        -0.3877, -0.0074, -0.0346, -0.8249], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.17660961/0.9400000\n",
      "grad_weights: tensor([-0.6843, -0.9998, -0.7736, -0.0062, -0.7305, -1.1015, -0.2381, -0.0165,\n",
      "        -0.9163, -0.5075, -0.8900, -1.6469, -0.2148, -0.1326, -0.1635, -0.0557,\n",
      "        -0.3865, -0.0074, -0.0344, -0.8221], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.17658316/0.9400000\n",
      "grad_weights: tensor([-0.6820, -0.9962, -0.7710, -0.0062, -0.7279, -1.0970, -0.2373, -0.0164,\n",
      "        -0.9123, -0.5055, -0.8861, -1.6393, -0.2138, -0.1321, -0.1629, -0.0555,\n",
      "        -0.3852, -0.0074, -0.0343, -0.8193], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.17655680/0.9400000\n",
      "grad_weights: tensor([-0.6796, -0.9926, -0.7684, -0.0062, -0.7252, -1.0926, -0.2365, -0.0164,\n",
      "        -0.9083, -0.5036, -0.8822, -1.6317, -0.2129, -0.1316, -0.1623, -0.0553,\n",
      "        -0.3840, -0.0073, -0.0341, -0.8165], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.17653050/0.9400000\n",
      "grad_weights: tensor([-0.6773, -0.9890, -0.7658, -0.0062, -0.7226, -1.0881, -0.2356, -0.0163,\n",
      "        -0.9043, -0.5016, -0.8783, -1.6242, -0.2120, -0.1312, -0.1617, -0.0551,\n",
      "        -0.3827, -0.0073, -0.0340, -0.8137], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.17650431/0.9400000\n",
      "grad_weights: tensor([-0.6750, -0.9854, -0.7632, -0.0062, -0.7199, -1.0837, -0.2348, -0.0162,\n",
      "        -0.9003, -0.4996, -0.8744, -1.6167, -0.2111, -0.1307, -0.1611, -0.0549,\n",
      "        -0.3815, -0.0073, -0.0339, -0.8109], device='cuda:1')\n",
      "####Few Shot 220 | 993 ####, loss/acc = 0.17647821/0.9400000\n",
      "grad_weights: tensor([-0.6727, -0.9818, -0.7606, -0.0061, -0.7173, -1.0794, -0.2340, -0.0162,\n",
      "        -0.8963, -0.4976, -0.8706, -1.6092, -0.2102, -0.1303, -0.1605, -0.0547,\n",
      "        -0.3803, -0.0073, -0.0337, -0.8082], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> Optimized weights: tensor([0.2552, 0.2552, 0.2552, 0.2552, 0.2552, 0.2551, 0.2552, 0.2551, 0.2551,\n",
      "        0.2551, 0.2551, 0.2551, 0.2551, 0.2552, 0.2552, 0.2552, 0.2552, 0.2552,\n",
      "        0.2551, 0.2552], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.7, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.3327,  0.4199, -0.3464, -0.4623, -0.0074, -0.0105, -0.2571, -0.9000,\n",
      "        -1.7724, -0.0559, -0.5193, -0.0069, -0.6481,  0.4340, -5.3873, -0.2324,\n",
      "        -2.0048, -0.1378, -2.9520, -0.1278], device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.17666723/0.9400000\n",
      "grad_weights: tensor([-0.3301,  0.4171, -0.3441, -0.4591, -0.0074, -0.0104, -0.2556, -0.8942,\n",
      "        -1.7584, -0.0554, -0.5144, -0.0068, -0.6421,  0.4322, -5.3521, -0.2306,\n",
      "        -1.9917, -0.1368, -2.9335, -0.1270], device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.17661850/0.9400000\n",
      "grad_weights: tensor([-0.3276,  0.4143, -0.3418, -0.4560, -0.0074, -0.0103, -0.2540, -0.8884,\n",
      "        -1.7445, -0.0550, -0.5095, -0.0068, -0.6363,  0.4302, -5.3170, -0.2287,\n",
      "        -1.9787, -0.1359, -2.9150, -0.1261], device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 240 | 993 ####, loss/acc = 0.17656998/0.9400000\n",
      "grad_weights: tensor([-0.3250,  0.4115, -0.3395, -0.4529, -0.0073, -0.0103, -0.2525, -0.8826,\n",
      "        -1.7307, -0.0546, -0.5046, -0.0068, -0.6304,  0.4283, -5.2819, -0.2269,\n",
      "        -1.9656, -0.1349, -2.8966, -0.1253], device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.17652179/0.9400000\n",
      "grad_weights: tensor([-0.3224,  0.4087, -0.3373, -0.4498, -0.0073, -0.0102, -0.2510, -0.8769,\n",
      "        -1.7169, -0.0542, -0.4997, -0.0067, -0.6246,  0.4264, -5.2469, -0.2265,\n",
      "        -1.9526, -0.1340, -2.8782, -0.1245], device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.17647387/0.9400000\n",
      "grad_weights: tensor([-0.3199,  0.4058, -0.3350, -0.4467, -0.0072, -0.0101, -0.2495, -0.8712,\n",
      "        -1.7033, -0.0538, -0.4949, -0.0067, -0.6189,  0.4245, -5.2122, -0.2247,\n",
      "        -1.9397, -0.1330, -2.8599, -0.1237], device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.17642619/0.9400000\n",
      "grad_weights: tensor([-0.3174,  0.4030, -0.3328, -0.4436, -0.0072, -0.0100, -0.2480, -0.8654,\n",
      "        -1.6897, -0.0534, -0.4902, -0.0066, -0.6132,  0.4226, -5.1775, -0.2229,\n",
      "        -1.9268, -0.1321, -2.8416, -0.1229], device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.17637885/0.9400000\n",
      "grad_weights: tensor([-0.3148,  0.4002, -0.3305, -0.4405, -0.0071, -0.0100, -0.2465, -0.8597,\n",
      "        -1.6762, -0.0530, -0.4854, -0.0066, -0.6075,  0.4206, -5.1428, -0.2211,\n",
      "        -1.9140, -0.1311, -2.8233, -0.1221], device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.17633177/0.9400000\n",
      "grad_weights: tensor([-0.3123,  0.3974, -0.3283, -0.4374, -0.0071, -0.0099, -0.2450, -0.8541,\n",
      "        -1.6628, -0.0526, -0.4807, -0.0066, -0.6019,  0.4188, -5.1087, -0.2194,\n",
      "        -1.9014, -0.1302, -2.8054, -0.1213], device='cuda:1')\n",
      "####Few Shot 240 | 993 ####, loss/acc = 0.17628498/0.9400000\n",
      "grad_weights: tensor([-0.3098,  0.3945, -0.3261, -0.4344, -0.0070, -0.0098, -0.2435, -0.8484,\n",
      "        -1.6495, -0.0522, -0.4761, -0.0065, -0.5963,  0.4168, -5.0743, -0.2176,\n",
      "        -1.8886, -0.1292, -2.7873, -0.1205], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.7777777777777778)\n",
      "=====> Optimized weights: tensor([ 0.2879, -0.2880,  0.2880,  0.2880,  0.2880,  0.2879,  0.2881,  0.2881,\n",
      "         0.2879,  0.2880,  0.2878,  0.2881,  0.2878, -0.2883,  0.2881,  0.2880,\n",
      "         0.2881,  0.2880,  0.2881,  0.2881], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-9.1458e-02, -3.8599e-01, -2.1982e+00, -4.5139e-02, -3.4392e-01,\n",
      "        -2.7419e-03, -3.2727e-01, -4.0448e+00, -2.0652e-01, -4.2375e+00,\n",
      "        -1.9248e-01, -8.3171e-01, -1.0339e+00, -2.4086e-02, -1.6359e-02,\n",
      "        -4.4843e-03, -2.2333e-02, -1.0384e-01, -9.7694e-03, -4.1855e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.17658077/0.9400000\n",
      "grad_weights: tensor([-8.9651e-02, -3.7528e-01, -2.1595e+00, -4.4283e-02, -3.3652e-01,\n",
      "        -2.6902e-03, -3.2075e-01, -3.9738e+00, -2.0287e-01, -4.1453e+00,\n",
      "        -1.8896e-01, -8.1728e-01, -1.0178e+00, -2.3658e-02, -1.6093e-02,\n",
      "        -4.3882e-03, -2.1881e-02, -1.0202e-01, -9.5672e-03, -4.1116e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.17644727/0.9400000\n",
      "grad_weights: tensor([-8.7866e-02, -3.6482e-01, -2.1210e+00, -4.3434e-02, -3.2923e-01,\n",
      "        -2.6388e-03, -3.1431e-01, -3.9033e+00, -1.9926e-01, -4.0543e+00,\n",
      "        -1.8548e-01, -8.0291e-01, -1.0023e+00, -2.3230e-02, -1.5829e-02,\n",
      "        -4.2930e-03, -2.1434e-02, -1.0021e-01, -9.3646e-03, -4.0382e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.17631578/0.9400000\n",
      "grad_weights: tensor([-8.6097e-02, -3.5459e-01, -2.0827e+00, -4.2588e-02, -3.2204e-01,\n",
      "        -2.5872e-03, -3.0793e-01, -3.8331e+00, -1.9567e-01, -3.9642e+00,\n",
      "        -1.8200e-01, -7.8863e-01, -9.8631e-01, -2.2808e-02, -1.5566e-02,\n",
      "        -4.1982e-03, -2.0991e-02, -9.8399e-02, -9.1627e-03, -3.9647e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.17618641/0.9400000\n",
      "grad_weights: tensor([-8.4355e-02, -3.4460e-01, -2.0449e+00, -4.1754e-02, -3.1500e-01,\n",
      "        -2.5363e-03, -3.0165e-01, -3.7635e+00, -1.9213e-01, -3.8755e+00,\n",
      "        -1.7858e-01, -7.7445e-01, -9.7054e-01, -2.2391e-02, -1.5305e-02,\n",
      "        -4.1047e-03, -2.0556e-02, -9.6610e-02, -8.9619e-03, -3.8920e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.17605910/0.9400000\n",
      "grad_weights: tensor([-8.2609e-02, -3.3485e-01, -2.0068e+00, -4.0915e-02, -3.0797e-01,\n",
      "        -2.4844e-03, -2.9536e-01, -3.6943e+00, -1.8856e-01, -3.7868e+00,\n",
      "        -1.7516e-01, -7.6032e-01, -9.5457e-01, -2.1972e-02, -1.5041e-02,\n",
      "        -4.0108e-03, -2.0120e-02, -9.4802e-02, -8.7612e-03, -3.8180e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.17593403/0.9400000\n",
      "grad_weights: tensor([-8.0851e-02, -3.2532e-01, -1.9680e+00, -4.0061e-02, -3.0093e-01,\n",
      "        -2.4327e-03, -2.8900e-01, -3.6224e+00, -1.8507e-01, -3.6972e+00,\n",
      "        -1.7160e-01, -7.4550e-01, -9.3892e-01, -2.1545e-02, -1.4782e-02,\n",
      "        -3.9185e-03, -1.9694e-02, -9.2940e-02, -8.5605e-03, -3.7452e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.17581122/0.9400000\n",
      "grad_weights: tensor([-7.9168e-02, -3.1603e-01, -1.9309e+00, -3.9244e-02, -2.9420e-01,\n",
      "        -2.3821e-03, -2.8294e-01, -3.5543e+00, -1.8162e-01, -3.6119e+00,\n",
      "        -1.6822e-01, -7.3159e-01, -9.2339e-01, -2.1137e-02, -1.4525e-02,\n",
      "        -3.8272e-03, -1.9274e-02, -9.1174e-02, -8.3614e-03, -3.6732e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.17569056/0.9400000\n",
      "grad_weights: tensor([-7.7509e-02, -3.0698e-01, -1.8943e+00, -3.8436e-02, -2.8759e-01,\n",
      "        -2.3318e-03, -2.7698e-01, -3.4868e+00, -1.7821e-01, -3.5279e+00,\n",
      "        -1.6487e-01, -7.1781e-01, -9.0797e-01, -2.0734e-02, -1.4271e-02,\n",
      "        -3.7371e-03, -1.8861e-02, -8.9422e-02, -8.1632e-03, -3.6015e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 260 | 993 ####, loss/acc = 0.17557219/0.9500000\n",
      "grad_weights: tensor([-7.5873e-02, -2.9816e-01, -1.8580e+00, -3.7638e-02, -2.8110e-01,\n",
      "        -2.2819e-03, -2.7110e-01, -3.4199e+00, -1.7485e-01, -3.4452e+00,\n",
      "        -1.6155e-01, -7.0416e-01, -8.9271e-01, -2.0334e-02, -1.4018e-02,\n",
      "        -3.6477e-03, -1.8454e-02, -8.7683e-02, -7.9655e-03, -3.5304e-02],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.6999, device='cuda:1'), 0.8, 0.85)\n",
      "=====> Optimized weights: tensor([0.9561, 0.9530, 0.9568, 0.9563, 0.9554, 0.9559, 0.9560, 0.9569, 0.9569,\n",
      "        0.9552, 0.9566, 0.9569, 0.9577, 0.9567, 0.9573, 0.9551, 0.9559, 0.9568,\n",
      "        0.9554, 0.9568], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762]\n",
      "=====> init acc: (tensor(0.9000, device='cuda:1'), 1.0, 0.95)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-7.5543e-01, -1.1635e-03, -1.4936e+00, -4.4820e-01, -2.2606e-01,\n",
      "        -4.6177e-01, -5.1076e-02, -3.9355e+00, -5.0654e-03, -5.1364e-02,\n",
      "        -9.9802e-01, -3.9703e-03, -4.1275e+00, -2.4137e+00, -1.0979e+00,\n",
      "        -1.8299e-01, -2.2528e-01, -2.5211e-02, -3.7185e-01, -1.2389e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.17666765/0.9400000\n",
      "grad_weights: tensor([-7.5037e-01, -1.1560e-03, -1.4836e+00, -4.4434e-01, -2.2445e-01,\n",
      "        -4.5885e-01, -5.0773e-02, -3.9108e+00, -5.0207e-03, -5.0963e-02,\n",
      "        -9.9157e-01, -3.9432e-03, -4.0964e+00, -2.3987e+00, -1.0916e+00,\n",
      "        -1.8160e-01, -2.2359e-01, -2.5016e-02, -3.6905e-01, -1.2315e+00],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 280 | 993 ####, loss/acc = 0.17661926/0.9400000\n",
      "grad_weights: tensor([-7.4531e-01, -1.1485e-03, -1.4735e+00, -4.4052e-01, -2.2285e-01,\n",
      "        -4.5593e-01, -5.0473e-02, -3.8862e+00, -4.9772e-03, -5.0563e-02,\n",
      "        -9.8514e-01, -3.9165e-03, -4.0654e+00, -2.3836e+00, -1.0853e+00,\n",
      "        -1.8021e-01, -2.2190e-01, -2.4821e-02, -3.6625e-01, -1.2242e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.17657122/0.9400000\n",
      "grad_weights: tensor([-7.4027e-01, -1.1411e-03, -1.4635e+00, -4.3673e-01, -2.2126e-01,\n",
      "        -4.5302e-01, -5.0172e-02, -3.8616e+00, -4.9332e-03, -5.0165e-02,\n",
      "        -9.7873e-01, -3.8896e-03, -4.0345e+00, -2.3686e+00, -1.0790e+00,\n",
      "        -1.7882e-01, -2.2023e-01, -2.4627e-02, -3.6348e-01, -1.2169e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.17652346/0.9400000\n",
      "grad_weights: tensor([-7.3524e-01, -1.1336e-03, -1.4535e+00, -4.3297e-01, -2.1968e-01,\n",
      "        -4.5011e-01, -4.9870e-02, -3.8371e+00, -4.8895e-03, -4.9771e-02,\n",
      "        -9.7234e-01, -3.8628e-03, -4.0037e+00, -2.3536e+00, -1.0727e+00,\n",
      "        -1.7745e-01, -2.1857e-01, -2.4433e-02, -3.6072e-01, -1.2096e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.17647591/0.9400000\n",
      "grad_weights: tensor([-7.3021e-01, -1.1262e-03, -1.4435e+00, -4.2923e-01, -2.1810e-01,\n",
      "        -4.4720e-01, -4.9569e-02, -3.8127e+00, -4.8467e-03, -4.9377e-02,\n",
      "        -9.6597e-01, -3.8361e-03, -3.9730e+00, -2.3386e+00, -1.0665e+00,\n",
      "        -1.7608e-01, -2.1691e-01, -2.4241e-02, -3.5797e-01, -1.2023e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.17642866/0.9400000\n",
      "grad_weights: tensor([-7.2520e-01, -1.1188e-03, -1.4335e+00, -4.2553e-01, -2.1653e-01,\n",
      "        -4.4432e-01, -4.9268e-02, -3.7883e+00, -4.8040e-03, -4.8986e-02,\n",
      "        -9.5965e-01, -3.8095e-03, -3.9426e+00, -2.3237e+00, -1.0603e+00,\n",
      "        -1.7473e-01, -2.1526e-01, -2.4051e-02, -3.5525e-01, -1.1951e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.17638171/0.9400000\n",
      "grad_weights: tensor([-7.2021e-01, -1.1114e-03, -1.4236e+00, -4.2185e-01, -2.1497e-01,\n",
      "        -4.4144e-01, -4.8967e-02, -3.7641e+00, -4.7614e-03, -4.8598e-02,\n",
      "        -9.5334e-01, -3.7832e-03, -3.9123e+00, -2.3089e+00, -1.0541e+00,\n",
      "        -1.7338e-01, -2.1363e-01, -2.3860e-02, -3.5254e-01, -1.1879e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.17633504/0.9400000\n",
      "grad_weights: tensor([-7.1523e-01, -1.1040e-03, -1.4137e+00, -4.1818e-01, -2.1341e-01,\n",
      "        -4.3855e-01, -4.8667e-02, -3.7399e+00, -4.7189e-03, -4.8211e-02,\n",
      "        -9.4704e-01, -3.7567e-03, -3.8821e+00, -2.2941e+00, -1.0479e+00,\n",
      "        -1.7203e-01, -2.1200e-01, -2.3671e-02, -3.4984e-01, -1.1806e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 280 | 993 ####, loss/acc = 0.17628866/0.9400000\n",
      "grad_weights: tensor([-7.1025e-01, -1.0963e-03, -1.4034e+00, -4.1443e-01, -2.1180e-01,\n",
      "        -4.3550e-01, -4.8353e-02, -3.7147e+00, -4.6753e-03, -4.7813e-02,\n",
      "        -9.4056e-01, -3.7293e-03, -3.8508e+00, -2.2785e+00, -1.0417e+00,\n",
      "        -1.7065e-01, -2.1032e-01, -2.3476e-02, -3.4706e-01, -1.1731e+00],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.9000, device='cuda:1'), 1.0, 0.95)\n",
      "=====> Optimized weights: tensor([0.2683, 0.2681, 0.2683, 0.2681, 0.2683, 0.2683, 0.2684, 0.2684, 0.2681,\n",
      "        0.2682, 0.2683, 0.2682, 0.2682, 0.2684, 0.2684, 0.2682, 0.2682, 0.2682,\n",
      "        0.2682, 0.2684], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305]\n",
      "=====> init acc: (tensor(0.9000, device='cuda:1'), 0.9, 0.95)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.3737, -0.1347, -0.5120, -0.0929, -0.2797, -0.1511, -0.0094, -0.0171,\n",
      "        -1.6741, -0.0050, -0.9659, -0.3796, -0.0405, -0.3530, -1.0390, -0.0542,\n",
      "        -0.0170, -0.2296, -0.3560, -0.0110], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.17667198/0.9400000\n",
      "grad_weights: tensor([-0.3710, -0.1334, -0.5084, -0.0923, -0.2775, -0.1500, -0.0094, -0.0170,\n",
      "        -1.6615, -0.0050, -0.9592, -0.3770, -0.0402, -0.3501, -1.0323, -0.0538,\n",
      "        -0.0168, -0.2275, -0.3524, -0.0109], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.17662804/0.9400000\n",
      "grad_weights: tensor([-0.3683, -0.1322, -0.5048, -0.0917, -0.2753, -0.1489, -0.0093, -0.0169,\n",
      "        -1.6490, -0.0050, -0.9526, -0.3744, -0.0399, -0.3471, -1.0256, -0.0534,\n",
      "        -0.0167, -0.2254, -0.3487, -0.0108], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.17658433/0.9400000\n",
      "grad_weights: tensor([-0.3657, -0.1310, -0.5012, -0.0910, -0.2731, -0.1478, -0.0093, -0.0168,\n",
      "        -1.6365, -0.0049, -0.9459, -0.3718, -0.0396, -0.3442, -1.0189, -0.0531,\n",
      "        -0.0166, -0.2233, -0.3452, -0.0107], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.17654087/0.9400000\n",
      "grad_weights: tensor([-0.3631, -0.1298, -0.4975, -0.0904, -0.2709, -0.1467, -0.0092, -0.0167,\n",
      "        -1.6241, -0.0049, -0.9393, -0.3691, -0.0393, -0.3414, -1.0123, -0.0527,\n",
      "        -0.0165, -0.2211, -0.3416, -0.0107], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.17649768/0.9400000\n",
      "grad_weights: tensor([-0.3605, -0.1286, -0.4939, -0.0898, -0.2687, -0.1456, -0.0091, -0.0165,\n",
      "        -1.6118, -0.0049, -0.9328, -0.3665, -0.0390, -0.3385, -1.0057, -0.0523,\n",
      "        -0.0163, -0.2191, -0.3381, -0.0106], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.17645475/0.9400000\n",
      "grad_weights: tensor([-0.3578, -0.1275, -0.4903, -0.0892, -0.2665, -0.1445, -0.0091, -0.0164,\n",
      "        -1.5994, -0.0048, -0.9262, -0.3639, -0.0387, -0.3357, -0.9991, -0.0519,\n",
      "        -0.0162, -0.2169, -0.3346, -0.0105], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.17641215/0.9400000\n",
      "grad_weights: tensor([-0.3553, -0.1263, -0.4869, -0.0885, -0.2643, -0.1434, -0.0090, -0.0163,\n",
      "        -1.5871, -0.0048, -0.9197, -0.3613, -0.0384, -0.3328, -0.9926, -0.0515,\n",
      "        -0.0161, -0.2150, -0.3312, -0.0104], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.17636979/0.9400000\n",
      "grad_weights: tensor([-0.3527, -0.1251, -0.4833, -0.0879, -0.2622, -0.1424, -0.0090, -0.0162,\n",
      "        -1.5750, -0.0047, -0.9132, -0.3588, -0.0381, -0.3300, -0.9860, -0.0512,\n",
      "        -0.0160, -0.2129, -0.3277, -0.0103], device='cuda:1')\n",
      "####Few Shot 300 | 993 ####, loss/acc = 0.17632771/0.9400000\n",
      "grad_weights: tensor([-0.3501, -0.1239, -0.4798, -0.0873, -0.2600, -0.1413, -0.0089, -0.0161,\n",
      "        -1.5628, -0.0047, -0.9067, -0.3562, -0.0378, -0.3272, -0.9795, -0.0508,\n",
      "        -0.0159, -0.2108, -0.3243, -0.0102], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.9000, device='cuda:1'), 0.9, 0.95)\n",
      "=====> Optimized weights: tensor([0.6604, 0.6600, 0.6604, 0.6605, 0.6602, 0.6604, 0.6605, 0.6606, 0.6603,\n",
      "        0.6602, 0.6605, 0.6605, 0.6603, 0.6602, 0.6606, 0.6604, 0.6604, 0.6599,\n",
      "        0.6597, 0.6602], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272]\n",
      "=====> init acc: (tensor(0.3000, device='cuda:1'), 0.6, 0.65)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-5.0501e-02, -1.4151e+00, -2.3558e-02, -7.2209e-03,  1.2821e+00,\n",
      "        -9.9684e-02,  4.0761e-01, -2.2583e+00, -3.1078e-01, -1.4389e-01,\n",
      "        -1.8742e-02, -2.1995e-02, -9.5549e-04,  9.7722e-01, -7.4152e-01,\n",
      "        -3.5973e-02, -1.3141e-01, -1.5418e-02, -2.7349e-02, -1.2015e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.17662466/0.9400000\n",
      "grad_weights: tensor([-4.9987e-02, -1.3969e+00, -2.3260e-02, -7.1908e-03,  1.2695e+00,\n",
      "        -9.8491e-02,  4.0272e-01, -2.2293e+00, -3.0638e-01, -1.4162e-01,\n",
      "        -1.8487e-02, -2.1708e-02, -9.4421e-04,  9.7106e-01, -7.3345e-01,\n",
      "        -3.5483e-02, -1.2979e-01, -1.5151e-02, -2.6936e-02, -1.1859e+00],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 320 | 993 ####, loss/acc = 0.17653398/0.9400000\n",
      "grad_weights: tensor([-4.9468e-02, -1.3788e+00, -2.2962e-02, -7.0919e-03,  1.2569e+00,\n",
      "        -9.7299e-02,  3.9779e-01, -2.2005e+00, -3.0202e-01, -1.3937e-01,\n",
      "        -1.8233e-02, -2.1421e-02, -9.3295e-04,  9.6482e-01, -7.2537e-01,\n",
      "        -3.4997e-02, -1.2818e-01, -1.4881e-02, -2.6517e-02, -1.1703e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.17644428/0.9400000\n",
      "grad_weights: tensor([-4.8958e-02, -1.3610e+00, -2.2667e-02, -6.9945e-03,  1.2444e+00,\n",
      "        -9.6121e-02,  3.9298e-01, -2.1720e+00, -2.9772e-01, -1.3715e-01,\n",
      "        -1.7981e-02, -2.1136e-02, -9.2191e-04,  9.5861e-01, -7.1739e-01,\n",
      "        -3.4516e-02, -1.2659e-01, -1.4617e-02, -2.6103e-02, -1.1549e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.17635554/0.9400000\n",
      "grad_weights: tensor([-4.8444e-02, -1.3432e+00, -2.2371e-02, -6.8972e-03,  1.2345e+00,\n",
      "        -9.4943e-02,  3.8809e-01, -2.1436e+00, -2.9344e-01, -1.3494e-01,\n",
      "        -1.7731e-02, -2.0852e-02, -9.1070e-04,  9.5227e-01, -7.0938e-01,\n",
      "        -3.4038e-02, -1.2499e-01, -1.4351e-02, -2.5690e-02, -1.1397e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.17626771/0.9400000\n",
      "grad_weights: tensor([-4.7926e-02, -1.3252e+00, -2.2076e-02, -6.7993e-03,  1.2215e+00,\n",
      "        -9.3748e-02,  3.8321e-01, -2.1150e+00, -2.8913e-01, -1.3273e-01,\n",
      "        -1.7480e-02, -2.0565e-02, -8.9939e-04,  9.4596e-01, -7.0128e-01,\n",
      "        -3.3556e-02, -1.2338e-01, -1.4084e-02, -2.5264e-02, -1.1242e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.17618091/0.9400000\n",
      "grad_weights: tensor([-4.7414e-02, -1.3077e+00, -2.1783e-02, -6.7038e-03,  1.2088e+00,\n",
      "        -9.2584e-02,  3.7832e-01, -2.0870e+00, -2.8492e-01, -1.3057e-01,\n",
      "        -1.7233e-02, -2.0283e-02, -8.8829e-04,  9.3951e-01, -6.9335e-01,\n",
      "        -3.3086e-02, -1.2180e-01, -1.3821e-02, -2.4851e-02, -1.1091e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.17609510/0.9400000\n",
      "grad_weights: tensor([-4.6903e-02, -1.2903e+00, -2.1491e-02, -6.6088e-03,  1.1961e+00,\n",
      "        -9.1426e-02,  3.7342e-01, -2.0592e+00, -2.8077e-01, -1.2844e-01,\n",
      "        -1.6989e-02, -2.0002e-02, -8.7730e-04,  9.3300e-01, -6.8543e-01,\n",
      "        -3.2620e-02, -1.2023e-01, -1.3558e-02, -2.4439e-02, -1.0941e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.17601033/0.9400000\n",
      "grad_weights: tensor([-4.6397e-02, -1.2731e+00, -2.1204e-02, -6.5150e-03,  1.1834e+00,\n",
      "        -9.0275e-02,  3.6859e-01, -2.0317e+00, -2.7665e-01, -1.2634e-01,\n",
      "        -1.6747e-02, -1.9723e-02, -8.6639e-04,  9.2645e-01, -6.7756e-01,\n",
      "        -3.2159e-02, -1.1868e-01, -1.3299e-02, -2.4030e-02, -1.0792e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 320 | 993 ####, loss/acc = 0.17592655/0.9400000\n",
      "grad_weights: tensor([-4.5890e-02, -1.2560e+00, -2.0916e-02, -6.4216e-03,  1.1706e+00,\n",
      "        -8.9132e-02,  3.6374e-01, -2.0044e+00, -2.7254e-01, -1.2426e-01,\n",
      "        -1.6506e-02, -1.9445e-02, -8.5557e-04,  9.1986e-01, -6.6971e-01,\n",
      "        -3.1701e-02, -1.1713e-01, -1.3041e-02, -2.3620e-02, -1.0644e+00],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.3998, device='cuda:1'), 0.6, 0.7058823529411765)\n",
      "=====> Optimized weights: tensor([ 0.9996,  0.9986,  0.9986,  0.9986, -0.9998,  0.9989, -0.9989,  0.9986,\n",
      "         0.9982,  0.9975,  0.9983,  0.9985,  0.9979, -1.0010,  0.9993,  0.9983,\n",
      "         0.9988,  0.9967,  0.9975,  0.9986], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421]\n",
      "=====> init acc: (tensor(0.3000, device='cuda:1'), 0.6, 0.65)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-1.2884, -0.5465, -0.1557,  0.3448, -0.6176, -0.7905, -1.2975, -0.0700,\n",
      "        -0.2705, -0.0207, -0.0224, -0.0397, -1.0879, -1.3074, -0.3331, -0.0351,\n",
      "        -0.0215, -0.1267, -0.0097, -0.0468], device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.17666219/0.9400000\n",
      "grad_weights: tensor([-1.2753, -0.5417, -0.1545,  0.3425, -0.6135, -0.7847, -1.2867, -0.0694,\n",
      "        -0.2681, -0.0205, -0.0222, -0.0394, -1.0801, -1.2970, -0.3303, -0.0348,\n",
      "        -0.0213, -0.1256, -0.0096, -0.0463], device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.17660856/0.9400000\n",
      "grad_weights: tensor([-1.2623, -0.5369, -0.1534,  0.3403, -0.6094, -0.7790, -1.2759, -0.0688,\n",
      "        -0.2658, -0.0204, -0.0220, -0.0391, -1.0724, -1.2867, -0.3274, -0.0346,\n",
      "        -0.0211, -0.1244, -0.0095, -0.0458], device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.17655520/0.9400000\n",
      "grad_weights: tensor([-1.2493, -0.5321, -0.1523,  0.3380, -0.6052, -0.7734, -1.2651, -0.0682,\n",
      "        -0.2634, -0.0202, -0.0219, -0.0388, -1.0647, -1.2763, -0.3244, -0.0343,\n",
      "        -0.0210, -0.1233, -0.0094, -0.0453], device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.17650229/0.9400000\n",
      "grad_weights: tensor([-1.2366, -0.5273, -0.1511,  0.3358, -0.6012, -0.7677, -1.2545, -0.0676,\n",
      "        -0.2610, -0.0200, -0.0217, -0.0384, -1.0570, -1.2661, -0.3215, -0.0341,\n",
      "        -0.0208, -0.1222, -0.0093, -0.0449], device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.17644969/0.9400000\n",
      "grad_weights: tensor([-1.2238, -0.5226, -0.1500,  0.3336, -0.5971, -0.7620, -1.2438, -0.0670,\n",
      "        -0.2586, -0.0199, -0.0215, -0.0381, -1.0493, -1.2558, -0.3187, -0.0338,\n",
      "        -0.0206, -0.1211, -0.0093, -0.0444], device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.17639746/0.9400000\n",
      "grad_weights: tensor([-1.2112, -0.5179, -0.1489,  0.3313, -0.5930, -0.7563, -1.2332, -0.0664,\n",
      "        -0.2563, -0.0197, -0.0213, -0.0378, -1.0417, -1.2456, -0.3158, -0.0336,\n",
      "        -0.0204, -0.1200, -0.0092, -0.0439], device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.17634562/0.9400000\n",
      "grad_weights: tensor([-1.1987, -0.5132, -0.1478,  0.3290, -0.5890, -0.7505, -1.2227, -0.0659,\n",
      "        -0.2539, -0.0195, -0.0212, -0.0375, -1.0341, -1.2355, -0.3130, -0.0333,\n",
      "        -0.0203, -0.1189, -0.0091, -0.0434], device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.17629418/0.9400000\n",
      "grad_weights: tensor([-1.1862, -0.5086, -0.1467,  0.3268, -0.5850, -0.7448, -1.2123, -0.0653,\n",
      "        -0.2516, -0.0194, -0.0210, -0.0371, -1.0264, -1.2254, -0.3101, -0.0331,\n",
      "        -0.0201, -0.1178, -0.0090, -0.0429], device='cuda:1')\n",
      "####Few Shot 340 | 993 ####, loss/acc = 0.17624310/0.9400000\n",
      "grad_weights: tensor([-1.1739, -0.5039, -0.1456,  0.3246, -0.5810, -0.7392, -1.2018, -0.0647,\n",
      "        -0.2493, -0.0192, -0.0208, -0.0368, -1.0188, -1.2153, -0.3073, -0.0328,\n",
      "        -0.0199, -0.1167, -0.0089, -0.0425], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.4000, device='cuda:1'), 0.6, 0.6842105263157895)\n",
      "=====> Optimized weights: tensor([ 0.6402,  0.6405,  0.6408, -0.6410,  0.6410,  0.6409,  0.6406,  0.6405,\n",
      "         0.6405,  0.6406,  0.6407,  0.6406,  0.6409,  0.6407,  0.6405,  0.6408,\n",
      "         0.6406,  0.6405,  0.6403,  0.6401], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([ 0.0241, -0.3655, -1.3142,  0.6741,  0.1310, -0.0390, -0.0179, -0.9559,\n",
      "        -0.1426, -0.1535, -0.1364, -0.8847, -0.4767, -0.1660, -0.2358, -0.0660,\n",
      "        -0.1037, -0.0826, -1.7602, -0.0121], device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.17666206/0.9400000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "grad_weights: tensor([ 0.0239, -0.3628, -1.3031,  0.6703,  0.1306, -0.0386, -0.0178, -0.9479,\n",
      "        -0.1412, -0.1521, -0.1352, -0.8785, -0.4727, -0.1646, -0.2338, -0.0654,\n",
      "        -0.1030, -0.0820, -1.7470, -0.0120], device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.17660826/0.9400000\n",
      "grad_weights: tensor([ 0.0238, -0.3601, -1.2922,  0.6665,  0.1302, -0.0383, -0.0176, -0.9398,\n",
      "        -0.1399, -0.1507, -0.1341, -0.8724, -0.4687, -0.1632, -0.2318, -0.0649,\n",
      "        -0.1023, -0.0813, -1.7338, -0.0119], device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.17655477/0.9400000\n",
      "grad_weights: tensor([ 0.0236, -0.3574, -1.2812,  0.6627,  0.1298, -0.0379, -0.0174, -0.9318,\n",
      "        -0.1385, -0.1492, -0.1330, -0.8662, -0.4648, -0.1618, -0.2299, -0.0643,\n",
      "        -0.1016, -0.0806, -1.7207, -0.0118], device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.17650169/0.9400000\n",
      "grad_weights: tensor([ 0.0234, -0.3547, -1.2704,  0.6588,  0.1294, -0.0376, -0.0172, -0.9239,\n",
      "        -0.1372, -0.1478, -0.1319, -0.8600, -0.4609, -0.1605, -0.2279, -0.0638,\n",
      "        -0.1009, -0.0800, -1.7077, -0.0117], device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.17644894/0.9400000\n",
      "grad_weights: tensor([ 0.0232, -0.3521, -1.2596,  0.6550,  0.1290, -0.0373, -0.0170, -0.9160,\n",
      "        -0.1359, -0.1464, -0.1308, -0.8539, -0.4570, -0.1591, -0.2259, -0.0632,\n",
      "        -0.1003, -0.0793, -1.6946, -0.0116], device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.17639656/0.9400000\n",
      "grad_weights: tensor([ 0.0230, -0.3494, -1.2488,  0.6512,  0.1286, -0.0369, -0.0169, -0.9082,\n",
      "        -0.1346, -0.1450, -0.1297, -0.8478, -0.4531, -0.1577, -0.2239, -0.0627,\n",
      "        -0.0996, -0.0786, -1.6816, -0.0115], device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.17634454/0.9400000\n",
      "grad_weights: tensor([ 0.0228, -0.3467, -1.2382,  0.6473,  0.1282, -0.0366, -0.0167, -0.9004,\n",
      "        -0.1332, -0.1436, -0.1286, -0.8417, -0.4493, -0.1564, -0.2220, -0.0621,\n",
      "        -0.0989, -0.0780, -1.6686, -0.0114], device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.17629290/0.9400000\n",
      "grad_weights: tensor([ 0.0226, -0.3441, -1.2275,  0.6435,  0.1278, -0.0363, -0.0165, -0.8926,\n",
      "        -0.1319, -0.1423, -0.1276, -0.8356, -0.4454, -0.1550, -0.2201, -0.0616,\n",
      "        -0.0982, -0.0773, -1.6557, -0.0113], device='cuda:1')\n",
      "####Few Shot 360 | 993 ####, loss/acc = 0.17624168/0.9400000\n",
      "grad_weights: tensor([ 0.0224, -0.3415, -1.2170,  0.6396,  0.1274, -0.0360, -0.0163, -0.8850,\n",
      "        -0.1307, -0.1409, -0.1265, -0.8295, -0.4416, -0.1537, -0.2181, -0.0610,\n",
      "        -0.0976, -0.0767, -1.6428, -0.0112], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.7000, device='cuda:1'), 1.0, 0.8823529411764706)\n",
      "=====> Optimized weights: tensor([-0.6995,  0.6997,  0.6994, -0.7001, -0.7007,  0.6993,  0.6990,  0.6994,\n",
      "         0.6992,  0.6992,  0.6995,  0.6998,  0.6995,  0.6994,  0.6994,  0.6994,\n",
      "         0.6999,  0.6995,  0.6997,  0.6995], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.7, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-4.0861e-01, -5.1378e-02, -4.0908e-01, -2.3896e-01, -2.9795e-03,\n",
      "        -2.9337e-01, -6.2266e-01,  9.0010e-01, -2.2524e-01, -1.1344e-01,\n",
      "        -1.8974e-01, -8.3740e-01, -1.2376e-01, -1.0601e-01, -4.4103e+00,\n",
      "        -1.2988e-01, -4.6341e+00, -2.9110e-02, -2.1151e+00, -2.3954e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.17664915/0.9400000\n",
      "grad_weights: tensor([-4.0459e-01, -5.0930e-02, -4.0560e-01, -2.3692e-01, -2.9475e-03,\n",
      "        -2.9088e-01, -6.1698e-01,  8.9434e-01, -2.2254e-01, -1.1203e-01,\n",
      "        -1.8790e-01, -8.2887e-01, -1.2271e-01, -1.0515e-01, -4.3742e+00,\n",
      "        -1.2804e-01, -4.5905e+00, -2.8811e-02, -2.0950e+00, -2.3749e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.17658256/0.9400000\n",
      "grad_weights: tensor([-4.0058e-01, -5.0484e-02, -4.0213e-01, -2.3488e-01, -2.9158e-03,\n",
      "        -2.8840e-01, -6.1132e-01,  8.8832e-01, -2.1986e-01, -1.1063e-01,\n",
      "        -1.8608e-01, -8.2038e-01, -1.2166e-01, -1.0431e-01, -4.3383e+00,\n",
      "        -1.2622e-01, -4.5470e+00, -2.8514e-02, -2.0749e+00, -2.3545e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.17651646/0.9400000\n",
      "grad_weights: tensor([-3.9660e-01, -5.0037e-02, -3.9866e-01, -2.3283e-01, -2.8843e-03,\n",
      "        -2.8592e-01, -6.0568e-01,  8.8229e-01, -2.1721e-01, -1.0925e-01,\n",
      "        -1.8426e-01, -8.1195e-01, -1.2062e-01, -1.0346e-01, -4.3024e+00,\n",
      "        -1.2443e-01, -4.5037e+00, -2.8218e-02, -2.0549e+00, -2.3340e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.17645088/0.9400000\n",
      "grad_weights: tensor([-3.9265e-01, -4.9593e-02, -3.9522e-01, -2.3081e-01, -2.8527e-03,\n",
      "        -2.8346e-01, -6.0008e-01,  8.7626e-01, -2.1458e-01, -1.0788e-01,\n",
      "        -1.8246e-01, -8.0361e-01, -1.1958e-01, -1.0263e-01, -4.2668e+00,\n",
      "        -1.2266e-01, -4.4608e+00, -2.7926e-02, -2.0351e+00, -2.3137e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.17638579/0.9400000\n",
      "grad_weights: tensor([-3.8872e-01, -4.9149e-02, -3.9178e-01, -2.2878e-01, -2.8218e-03,\n",
      "        -2.8099e-01, -5.9447e-01,  8.7020e-01, -2.1198e-01, -1.0652e-01,\n",
      "        -1.8066e-01, -7.9528e-01, -1.1855e-01, -1.0179e-01, -4.2311e+00,\n",
      "        -1.2091e-01, -4.4178e+00, -2.7633e-02, -2.0153e+00, -2.2935e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.17632122/0.9400000\n",
      "grad_weights: tensor([-3.8480e-01, -4.8704e-02, -3.8836e-01, -2.2676e-01, -2.7906e-03,\n",
      "        -2.7853e-01, -5.8888e-01,  8.6413e-01, -2.0940e-01, -1.0517e-01,\n",
      "        -1.7887e-01, -7.8700e-01, -1.1751e-01, -1.0095e-01, -4.1955e+00,\n",
      "        -1.1918e-01, -4.3751e+00, -2.7343e-02, -1.9956e+00, -2.2732e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.17625719/0.9400000\n",
      "grad_weights: tensor([-3.8092e-01, -4.8266e-02, -3.8497e-01, -2.2476e-01, -2.7598e-03,\n",
      "        -2.7609e-01, -5.8333e-01,  8.5806e-01, -2.0684e-01, -1.0383e-01,\n",
      "        -1.7709e-01, -7.7882e-01, -1.1649e-01, -1.0011e-01, -4.1603e+00,\n",
      "        -1.1747e-01, -4.3328e+00, -2.7056e-02, -1.9760e+00, -2.2533e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.17619373/0.9400000\n",
      "grad_weights: tensor([-3.7709e-01, -4.7835e-02, -3.8163e-01, -2.2276e-01, -2.7298e-03,\n",
      "        -2.7370e-01, -5.7781e-01,  8.5203e-01, -2.0433e-01, -1.0252e-01,\n",
      "        -1.7534e-01, -7.7069e-01, -1.1547e-01, -9.9284e-02, -4.1252e+00,\n",
      "        -1.1579e-01, -4.2907e+00, -2.6771e-02, -1.9567e+00, -2.2333e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 380 | 993 ####, loss/acc = 0.17613077/0.9400000\n",
      "grad_weights: tensor([-3.7326e-01, -4.7396e-02, -3.7824e-01, -2.2077e-01, -2.6995e-03,\n",
      "        -2.7127e-01, -5.7229e-01,  8.4594e-01, -2.0183e-01, -1.0121e-01,\n",
      "        -1.7358e-01, -7.6259e-01, -1.1166e-01, -9.8453e-02, -4.0900e+00,\n",
      "        -1.1412e-01, -4.2487e+00, -2.6487e-02, -1.9373e+00, -2.2133e-01],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.5001, device='cuda:1'), 0.8, 0.7368421052631579)\n",
      "=====> Optimized weights: tensor([ 0.4171,  0.4172,  0.4173,  0.4172,  0.4168,  0.4173,  0.4172, -0.4175,\n",
      "         0.4167,  0.4167,  0.4171,  0.4170,  0.4172,  0.4173,  0.4173,  0.4164,\n",
      "         0.4171,  0.4170,  0.4171,  0.4172], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852]\n",
      "reset tmp model\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.7, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-3.2196e+00, -3.9512e-01, -3.8005e-01, -3.1955e-02, -1.2718e-03,\n",
      "        -2.8723e+00, -4.0566e-01, -1.9643e+00, -2.4968e-01, -7.3999e-01,\n",
      "        -3.3476e-01, -3.0923e-02, -8.2786e-03, -6.1088e-01, -1.3675e+00,\n",
      "        -3.1640e-03, -3.5248e-01, -5.2792e-01, -1.2591e+00, -2.4836e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.17667682/0.9400000\n",
      "grad_weights: tensor([-3.2025e+00, -3.9282e-01, -3.7799e-01, -3.1790e-02, -1.2648e-03,\n",
      "        -2.8574e+00, -4.0285e-01, -1.9513e+00, -2.4847e-01, -7.3558e-01,\n",
      "        -3.3260e-01, -3.0757e-02, -8.2304e-03, -6.0760e-01, -1.3601e+00,\n",
      "        -3.1458e-03, -3.5077e-01, -5.2477e-01, -1.2504e+00, -2.4707e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.17663759/0.9400000\n",
      "grad_weights: tensor([-3.1856e+00, -3.9053e-01, -3.7594e-01, -3.1626e-02, -1.2578e-03,\n",
      "        -2.8426e+00, -4.0007e-01, -1.9383e+00, -2.4727e-01, -7.3119e-01,\n",
      "        -3.3046e-01, -3.0591e-02, -8.1822e-03, -6.0432e-01, -1.3526e+00,\n",
      "        -3.1277e-03, -3.4907e-01, -5.2162e-01, -1.2417e+00, -2.4580e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.17659853/0.9400000\n",
      "grad_weights: tensor([-3.1686e+00, -3.8824e-01, -3.7389e-01, -3.1462e-02, -1.2511e-03,\n",
      "        -2.8278e+00, -3.9728e-01, -1.9254e+00, -2.4607e-01, -7.2682e-01,\n",
      "        -3.2832e-01, -3.0426e-02, -8.1345e-03, -6.0104e-01, -1.3452e+00,\n",
      "        -3.1097e-03, -3.4738e-01, -5.1849e-01, -1.2330e+00, -2.4452e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.17655963/0.9400000\n",
      "grad_weights: tensor([-3.1517e+00, -3.8596e-01, -3.7184e-01, -3.1298e-02, -1.2442e-03,\n",
      "        -2.8131e+00, -3.9450e-01, -1.9125e+00, -2.4488e-01, -7.2246e-01,\n",
      "        -3.2617e-01, -3.0261e-02, -8.0870e-03, -5.9778e-01, -1.3378e+00,\n",
      "        -3.0918e-03, -3.4569e-01, -5.1534e-01, -1.2244e+00, -2.4325e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.17652091/0.9400000\n",
      "grad_weights: tensor([-3.1349e+00, -3.8369e-01, -3.6980e-01, -3.1134e-02, -1.2373e-03,\n",
      "        -2.7983e+00, -3.9173e-01, -1.8997e+00, -2.4368e-01, -7.1811e-01,\n",
      "        -3.2403e-01, -3.0097e-02, -8.0395e-03, -5.9452e-01, -1.3304e+00,\n",
      "        -3.0737e-03, -3.4399e-01, -5.1220e-01, -1.2158e+00, -2.4198e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.17648238/0.9400000\n",
      "grad_weights: tensor([-3.1182e+00, -3.8144e-01, -3.6777e-01, -3.0969e-02, -1.2303e-03,\n",
      "        -2.7837e+00, -3.8899e-01, -1.8870e+00, -2.4249e-01, -7.1379e-01,\n",
      "        -3.2188e-01, -2.9932e-02, -7.9923e-03, -5.9129e-01, -1.3231e+00,\n",
      "        -3.0556e-03, -3.4232e-01, -5.0905e-01, -1.2073e+00, -2.4072e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.17644405/0.9400000\n",
      "grad_weights: tensor([-3.1015e+00, -3.7919e-01, -3.6574e-01, -3.0805e-02, -1.2234e-03,\n",
      "        -2.7691e+00, -3.8625e-01, -1.8743e+00, -2.4130e-01, -7.0948e-01,\n",
      "        -3.1974e-01, -2.9768e-02, -7.9449e-03, -5.8805e-01, -1.3158e+00,\n",
      "        -3.0376e-03, -3.4063e-01, -5.0591e-01, -1.1989e+00, -2.3945e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.17640591/0.9400000\n",
      "grad_weights: tensor([-3.0848e+00, -3.7694e-01, -3.6372e-01, -3.0642e-02, -1.2165e-03,\n",
      "        -2.7544e+00, -3.8351e-01, -1.8617e+00, -2.4011e-01, -7.0519e-01,\n",
      "        -3.1761e-01, -2.9605e-02, -7.8979e-03, -5.8481e-01, -1.3085e+00,\n",
      "        -3.0193e-03, -3.3895e-01, -5.0275e-01, -1.1904e+00, -2.3819e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 400 | 993 ####, loss/acc = 0.17636795/0.9400000\n",
      "grad_weights: tensor([-3.0682e+00, -3.7471e-01, -3.6171e-01, -3.0479e-02, -1.2097e-03,\n",
      "        -2.7399e+00, -3.8079e-01, -1.8492e+00, -2.3893e-01, -7.0092e-01,\n",
      "        -3.1547e-01, -2.9443e-02, -7.8509e-03, -5.8160e-01, -1.3012e+00,\n",
      "        -3.0014e-03, -3.3727e-01, -4.9963e-01, -1.1820e+00, -2.3693e-01],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> Optimized weights: tensor([0.2627, 0.2626, 0.2626, 0.2627, 0.2624, 0.2627, 0.2625, 0.2625, 0.2627,\n",
      "        0.2626, 0.2625, 0.2626, 0.2626, 0.2626, 0.2626, 0.2625, 0.2627, 0.2626,\n",
      "        0.2625, 0.2627], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([ 0.1517, -0.0055, -0.5393, -0.0054, -0.3521, -0.3055, -0.0494, -0.3285,\n",
      "         3.6955, -0.0259, -0.0134, -0.9087, -0.0119, -0.0552, -0.2548, -0.5879,\n",
      "        -0.2058, -2.0711, -0.9638, -1.0954], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.17667069/0.9400000\n",
      "grad_weights: tensor([ 0.1514, -0.0055, -0.5358, -0.0053, -0.3497, -0.3034, -0.0491, -0.3267,\n",
      "         3.6847, -0.0257, -0.0133, -0.9036, -0.0118, -0.0548, -0.2517, -0.5844,\n",
      "        -0.2044, -2.0583, -0.9554, -1.0891], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.17662539/0.9400000\n",
      "grad_weights: tensor([ 0.1510, -0.0054, -0.5324, -0.0053, -0.3473, -0.3014, -0.0489, -0.3249,\n",
      "         3.6738, -0.0255, -0.0132, -0.8985, -0.0118, -0.0545, -0.2487, -0.5809,\n",
      "        -0.2031, -2.0456, -0.9470, -1.0829], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.17658029/0.9400000\n",
      "grad_weights: tensor([ 0.1506, -0.0054, -0.5290, -0.0053, -0.3450, -0.2993, -0.0486, -0.3231,\n",
      "         3.6629, -0.0254, -0.0132, -0.8934, -0.0117, -0.0542, -0.2457, -0.5774,\n",
      "        -0.2018, -2.0329, -0.9387, -1.0766], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.17653543/0.9400000\n",
      "grad_weights: tensor([ 0.1503, -0.0054, -0.5255, -0.0052, -0.3426, -0.2972, -0.0483, -0.3213,\n",
      "         3.6519, -0.0252, -0.0131, -0.8883, -0.0116, -0.0538, -0.2427, -0.5739,\n",
      "        -0.2005, -2.0202, -0.9305, -1.0703], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.17649078/0.9400000\n",
      "grad_weights: tensor([ 0.1499, -0.0053, -0.5221, -0.0052, -0.3402, -0.2952, -0.0480, -0.3196,\n",
      "         3.6410, -0.0251, -0.0130, -0.8832, -0.0115, -0.0535, -0.2398, -0.5704,\n",
      "        -0.1993, -2.0076, -0.9223, -1.0641], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.17644639/0.9400000\n",
      "grad_weights: tensor([ 0.1495, -0.0053, -0.5187, -0.0052, -0.3379, -0.2931, -0.0477, -0.3178,\n",
      "         3.6299, -0.0249, -0.0129, -0.8780, -0.0115, -0.0532, -0.2369, -0.5670,\n",
      "        -0.1980, -1.9950, -0.9142, -1.0579], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.17640221/0.9400000\n",
      "grad_weights: tensor([ 0.1492, -0.0052, -0.5153, -0.0051, -0.3355, -0.2911, -0.0474, -0.3160,\n",
      "         3.6188, -0.0247, -0.0128, -0.8730, -0.0114, -0.0528, -0.2340, -0.5635,\n",
      "        -0.1967, -1.9825, -0.9061, -1.0517], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.17635831/0.9400000\n",
      "grad_weights: tensor([ 0.1488, -0.0052, -0.5120, -0.0051, -0.3332, -0.2891, -0.0471, -0.3142,\n",
      "         3.6077, -0.0246, -0.0127, -0.8679, -0.0113, -0.0525, -0.2312, -0.5601,\n",
      "        -0.1954, -1.9699, -0.8981, -1.0455], device='cuda:1')\n",
      "####Few Shot 420 | 993 ####, loss/acc = 0.17631464/0.9400000\n",
      "grad_weights: tensor([ 0.1484, -0.0052, -0.5086, -0.0051, -0.3309, -0.2871, -0.0469, -0.3124,\n",
      "         3.5965, -0.0244, -0.0126, -0.8629, -0.0112, -0.0522, -0.2284, -0.5566,\n",
      "        -0.1941, -1.9575, -0.8901, -1.0392], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.5001, device='cuda:1'), 0.8, 0.7777777777777778)\n",
      "=====> Optimized weights: tensor([-0.3921,  0.3915,  0.3916,  0.3916,  0.3916,  0.3916,  0.3917,  0.3917,\n",
      "        -0.3921,  0.3916,  0.3915,  0.3917,  0.3916,  0.3916,  0.3908,  0.3917,\n",
      "         0.3916,  0.3916,  0.3913,  0.3917], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 440 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.1287, -0.0805, -0.2008, -5.5724, -0.9568, -0.0105, -0.0077, -1.2489,\n",
      "        -0.7218, -0.0291, -0.3203, -0.2600, -2.5989, -0.8120, -0.0863, -0.3633,\n",
      "        -0.2648,  0.5910, -2.8558, -0.1560], device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.17665122/0.9400000\n",
      "grad_weights: tensor([-0.1273, -0.0798, -0.1990, -5.5313, -0.9471, -0.0104, -0.0076, -1.2389,\n",
      "        -0.7161, -0.0288, -0.3173, -0.2578, -2.5735, -0.8046, -0.0854, -0.3598,\n",
      "        -0.2624,  0.5900, -2.8281, -0.1545], device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.17658664/0.9400000\n",
      "grad_weights: tensor([-0.1259, -0.0791, -0.1971, -5.4902, -0.9375, -0.0103, -0.0075, -1.2289,\n",
      "        -0.7104, -0.0285, -0.3143, -0.2555, -2.5482, -0.7973, -0.0844, -0.3564,\n",
      "        -0.2599,  0.5890, -2.8005, -0.1531], device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.17652255/0.9400000\n",
      "grad_weights: tensor([-0.1245, -0.0783, -0.1953, -5.4495, -0.9279, -0.0102, -0.0075, -1.2190,\n",
      "        -0.7047, -0.0281, -0.3113, -0.2532, -2.5230, -0.7900, -0.0835, -0.3529,\n",
      "        -0.2575,  0.5880, -2.7732, -0.1516], device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.17645895/0.9400000\n",
      "grad_weights: tensor([-0.1231, -0.0776, -0.1935, -5.4086, -0.9184, -0.0101, -0.0074, -1.2091,\n",
      "        -0.6990, -0.0278, -0.3084, -0.2510, -2.4979, -0.7827, -0.0826, -0.3495,\n",
      "        -0.2551,  0.5870, -2.7459, -0.1501], device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.17639576/0.9400000\n",
      "grad_weights: tensor([-0.1218, -0.0769, -0.1917, -5.3679, -0.9090, -0.0100, -0.0073, -1.1992,\n",
      "        -0.6933, -0.0275, -0.3055, -0.2487, -2.4730, -0.7755, -0.0816, -0.3461,\n",
      "        -0.2527,  0.5859, -2.7188, -0.1487], device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.17633307/0.9400000\n",
      "grad_weights: tensor([-0.1204, -0.0762, -0.1899, -5.3273, -0.8996, -0.0099, -0.0073, -1.1893,\n",
      "        -0.6877, -0.0272, -0.3025, -0.2465, -2.4482, -0.7683, -0.0807, -0.3427,\n",
      "        -0.2503,  0.5848, -2.6918, -0.1472], device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.17627083/0.9400000\n",
      "grad_weights: tensor([-0.1190, -0.0755, -0.1881, -5.2854, -0.8901, -0.0099, -0.0072, -1.1792,\n",
      "        -0.6819, -0.0269, -0.2996, -0.2442, -2.4229, -0.7610, -0.0798, -0.3393,\n",
      "        -0.2479,  0.5836, -2.6643, -0.1458], device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.17620912/0.9400000\n",
      "grad_weights: tensor([-0.1177, -0.0747, -0.1863, -5.2454, -0.8809, -0.0098, -0.0071, -1.1694,\n",
      "        -0.6763, -0.0265, -0.2967, -0.2420, -2.3984, -0.7539, -0.0789, -0.3359,\n",
      "        -0.2455,  0.5825, -2.6378, -0.1444], device='cuda:1')\n",
      "####Few Shot 440 | 993 ####, loss/acc = 0.17614789/0.9400000\n",
      "grad_weights: tensor([-0.1164, -0.0740, -0.1845, -5.2051, -0.8717, -0.0097, -0.0071, -1.1597,\n",
      "        -0.6707, -0.0262, -0.2938, -0.2398, -2.3740, -0.7468, -0.0780, -0.3326,\n",
      "        -0.2431,  0.5813, -2.6114, -0.1429], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.3996, device='cuda:1'), 0.5, 0.7368421052631579)\n",
      "=====> Optimized weights: tensor([ 0.3762,  0.3764,  0.3764,  0.3767,  0.3763,  0.3765,  0.3765,  0.3766,\n",
      "         0.3766,  0.3761,  0.3764,  0.3765,  0.3763,  0.3764,  0.3762,  0.3764,\n",
      "         0.3764, -0.3774,  0.3763,  0.3764], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677]\n",
      "=====> init acc: (tensor(0.1000, device='cuda:1'), 0.6, 0.55)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.0095, -0.8645, -0.2976, -2.7703, -2.0731, -0.2780, -0.3385, -0.8186,\n",
      "        -0.7308, -0.0223, -0.2125, -0.1717, -0.0100,  1.1294, -0.0222, -0.1276,\n",
      "         0.9135, -0.1657, -0.4755,  0.8735], device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.17667493/0.9400000\n",
      "grad_weights: tensor([-0.0095, -0.8593, -0.2960, -2.7477, -2.0610, -0.2765, -0.3366, -0.8144,\n",
      "        -0.7248, -0.0221, -0.2111, -0.1707, -0.0100,  1.1256, -0.0221, -0.1268,\n",
      "         0.9138, -0.1647, -0.4731,  0.8708], device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.17663385/0.9400000\n",
      "grad_weights: tensor([-0.0094, -0.8542, -0.2943, -2.7253, -2.0490, -0.2750, -0.3347, -0.8101,\n",
      "        -0.7188, -0.0220, -0.2098, -0.1697, -0.0099,  1.1219, -0.0219, -0.1259,\n",
      "         0.9142, -0.1637, -0.4707,  0.8682], device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.17659298/0.9400000\n",
      "grad_weights: tensor([-0.0094, -0.8490, -0.2927, -2.7030, -2.0370, -0.2735, -0.3329, -0.8059,\n",
      "        -0.7129, -0.0218, -0.2084, -0.1687, -0.0099,  1.1182, -0.0218, -0.1251,\n",
      "         0.9145, -0.1627, -0.4683,  0.8655], device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.17655224/0.9400000\n",
      "grad_weights: tensor([-0.0093, -0.8439, -0.2910, -2.6808, -2.0250, -0.2720, -0.3310, -0.8016,\n",
      "        -0.7069, -0.0217, -0.2070, -0.1677, -0.0098,  1.1144, -0.0217, -0.1243,\n",
      "         0.9148, -0.1617, -0.4658,  0.8628], device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.17651172/0.9400000\n",
      "grad_weights: tensor([-0.0092, -0.8388, -0.2894, -2.6589, -2.0131, -0.2705, -0.3292, -0.7975,\n",
      "        -0.7011, -0.0215, -0.2056, -0.1668, -0.0097,  1.1107, -0.0216, -0.1235,\n",
      "         0.9151, -0.1607, -0.4635,  0.8602], device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.17647137/0.9400000\n",
      "grad_weights: tensor([-0.0092, -0.8337, -0.2878, -2.6371, -2.0012, -0.2690, -0.3273, -0.7932,\n",
      "        -0.6953, -0.0214, -0.2043, -0.1658, -0.0097,  1.1069, -0.0215, -0.1227,\n",
      "         0.9153, -0.1597, -0.4611,  0.8575], device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.17643122/0.9400000\n",
      "grad_weights: tensor([-0.0091, -0.8287, -0.2861, -2.6156, -1.9893, -0.2676, -0.3255, -0.7890,\n",
      "        -0.6895, -0.0212, -0.2029, -0.1648, -0.0096,  1.1031, -0.0213, -0.1219,\n",
      "         0.9155, -0.1587, -0.4587,  0.8548], device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.17639126/0.9400000\n",
      "grad_weights: tensor([-0.0091, -0.8236, -0.2845, -2.5940, -1.9775, -0.2661, -0.3237, -0.7849,\n",
      "        -0.6837, -0.0211, -0.2015, -0.1638, -0.0096,  1.0994, -0.0212, -0.1211,\n",
      "         0.9158, -0.1578, -0.4563,  0.8521], device='cuda:1')\n",
      "####Few Shot 460 | 993 ####, loss/acc = 0.17635153/0.9400000\n",
      "grad_weights: tensor([-0.0090, -0.8186, -0.2829, -2.5726, -1.9658, -0.2646, -0.3218, -0.7807,\n",
      "        -0.6780, -0.0209, -0.2002, -0.1629, -0.0095,  1.0956, -0.0211, -0.1203,\n",
      "         0.9160, -0.1568, -0.4540,  0.8494], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(-1.6652e-05, device='cuda:1'), 0.5, 0.5294117647058824)\n",
      "=====> Optimized weights: tensor([ 0.3353,  0.3353,  0.3354,  0.3351,  0.3353,  0.3354,  0.3354,  0.3354,\n",
      "         0.3351,  0.3352,  0.3353,  0.3353,  0.3353, -0.3356,  0.3354,  0.3353,\n",
      "        -0.3360,  0.3353,  0.3354, -0.3357], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-1.1198e-01, -7.7990e+00, -4.6584e-02, -2.4277e-02, -6.4175e-03,\n",
      "        -1.5811e+00, -5.6493e+00, -1.9613e-01, -3.7613e+00, -4.1142e-01,\n",
      "        -9.6537e-02, -6.0790e-01, -1.5115e-02, -3.0459e-01, -5.3885e-02,\n",
      "        -5.2754e-02, -1.1862e+00, -5.5250e-01, -3.1144e-02, -1.5506e-02],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 480 | 993 ####, loss/acc = 0.17651723/0.9400000\n",
      "grad_weights: tensor([-1.0916e-01, -7.6049e+00, -4.4942e-02, -2.3648e-02, -6.2020e-03,\n",
      "        -1.5361e+00, -5.5093e+00, -1.9137e-01, -3.6676e+00, -4.0049e-01,\n",
      "        -9.3376e-02, -5.9307e-01, -1.4694e-02, -2.9758e-01, -5.2107e-02,\n",
      "        -5.1243e-02, -1.1605e+00, -5.3578e-01, -3.0366e-02, -1.5094e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.17632248/0.9400000\n",
      "grad_weights: tensor([-1.0634e-01, -7.4121e+00, -4.3340e-02, -2.3021e-02, -5.9868e-03,\n",
      "        -1.4916e+00, -5.3699e+00, -1.8664e-01, -3.5744e+00, -3.8965e-01,\n",
      "        -9.0281e-02, -5.7836e-01, -1.4279e-02, -2.9060e-01, -5.0368e-02,\n",
      "        -4.9738e-02, -1.1349e+00, -5.1930e-01, -2.9593e-02, -1.4686e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.17613192/0.9400000\n",
      "grad_weights: tensor([-1.0353e-01, -7.2196e+00, -4.1770e-02, -2.2393e-02, -5.7729e-03,\n",
      "        -1.4475e+00, -5.2319e+00, -1.8191e-01, -3.4812e+00, -3.7885e-01,\n",
      "        -8.7246e-02, -5.6750e-01, -1.3865e-02, -2.8364e-01, -4.8660e-02,\n",
      "        -4.8245e-02, -1.1094e+00, -5.0355e-01, -2.8818e-02, -1.4280e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.17594570/0.9400000\n",
      "grad_weights: tensor([-1.0076e-01, -7.0307e+00, -4.0252e-02, -2.1775e-02, -5.5597e-03,\n",
      "        -1.4044e+00, -5.0947e+00, -1.7726e-01, -3.3898e+00, -3.6826e-01,\n",
      "        -8.4296e-02, -5.5295e-01, -1.3463e-02, -2.7685e-01, -4.7001e-02,\n",
      "        -4.6770e-02, -1.0842e+00, -4.8762e-01, -2.8058e-02, -1.3881e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.17576399/0.9400000\n",
      "grad_weights: tensor([-9.7964e-02, -6.8390e+00, -3.8747e-02, -2.1148e-02, -5.3476e-03,\n",
      "        -1.3610e+00, -4.9544e+00, -1.7256e-01, -3.2992e+00, -3.5781e-01,\n",
      "        -8.1364e-02, -5.3855e-01, -1.3057e-02, -2.7010e-01, -4.5353e-02,\n",
      "        -4.5299e-02, -1.0582e+00, -4.7159e-01, -2.7304e-02, -1.3477e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.17558675/0.9500000\n",
      "grad_weights: tensor([-9.5252e-02, -6.6546e+00, -3.7313e-02, -2.0541e-02, -5.1372e-03,\n",
      "        -1.3194e+00, -4.8199e+00, -1.6801e-01, -3.2097e+00, -3.4751e-01,\n",
      "        -7.8560e-02, -5.2434e-01, -1.2668e-02, -2.6343e-01, -4.3776e-02,\n",
      "        -4.3855e-02, -1.0335e+00, -4.5627e-01, -2.6559e-02, -1.3089e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.17541404/0.9500000\n",
      "grad_weights: tensor([-9.2565e-02, -6.4722e+00, -3.5920e-02, -1.9939e-02, -4.9282e-03,\n",
      "        -1.2786e+00, -4.6865e+00, -1.6352e-01, -3.1211e+00, -3.3733e-01,\n",
      "        -7.5822e-02, -5.1028e-01, -1.2286e-02, -2.5684e-01, -4.2238e-02,\n",
      "        -4.2425e-02, -1.0089e+00, -4.4122e-01, -2.5822e-02, -1.2705e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.17524594/0.9500000\n",
      "grad_weights: tensor([-8.9982e-02, -6.2896e+00, -3.4554e-02, -1.9337e-02, -4.7211e-03,\n",
      "        -1.2380e+00, -4.5531e+00, -1.5902e-01, -3.0323e+00, -3.2714e-01,\n",
      "        -7.3132e-02, -4.9625e-01, -1.1906e-02, -2.5034e-01, -4.0723e-02,\n",
      "        -4.1001e-02, -9.8451e-01, -4.2631e-01, -2.5086e-02, -1.2329e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 480 | 993 ####, loss/acc = 0.17508250/0.9500000\n",
      "grad_weights: tensor([-8.7354e-02, -6.1123e+00, -3.3242e-02, -1.8747e-02, -4.5151e-03,\n",
      "        -1.1987e+00, -4.4228e+00, -1.5464e-01, -2.9460e+00, -3.1727e-01,\n",
      "        -7.0541e-02, -4.8254e-01, -1.1538e-02, -2.4392e-01, -3.9265e-02,\n",
      "        -3.9604e-02, -9.6041e-01, -4.1187e-01, -2.4366e-02, -1.1956e-02],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.7000, device='cuda:1'), 0.8, 0.85)\n",
      "=====> Optimized weights: tensor([0.8842, 0.8844, 0.8805, 0.8838, 0.8801, 0.8830, 0.8844, 0.8846, 0.8844,\n",
      "        0.8837, 0.8815, 0.8850, 0.8832, 0.8852, 0.8814, 0.8827, 0.8856, 0.8824,\n",
      "        0.8843, 0.8837], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824]\n",
      "=====> init acc: (tensor(0.8000, device='cuda:1'), 0.8, 0.9)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-7.1589e-02, -1.9067e-02, -1.6080e-01, -1.4388e+00, -1.2691e-01,\n",
      "        -3.3441e-01, -4.5611e+00, -2.1594e-01, -1.7663e-02, -1.0229e+00,\n",
      "        -2.5101e-02, -3.7329e-03, -3.8607e-03, -8.0301e-02, -9.6480e-01,\n",
      "        -4.1515e-01, -2.4547e-01, -4.0168e-03, -4.3376e-02, -1.2031e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.17663021/0.9400000\n",
      "grad_weights: tensor([-7.0879e-02, -1.8856e-02, -1.5879e-01, -1.4199e+00, -1.2565e-01,\n",
      "        -3.3081e-01, -4.5117e+00, -2.1258e-01, -1.7460e-02, -1.0119e+00,\n",
      "        -2.4800e-02, -3.6789e-03, -3.8132e-03, -7.9116e-02, -9.5224e-01,\n",
      "        -4.1071e-01, -2.4255e-01, -3.9680e-03, -4.2735e-02, -1.1899e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.17654508/0.9400000\n",
      "grad_weights: tensor([-7.0171e-02, -1.8646e-02, -1.5678e-01, -1.4011e+00, -1.2439e-01,\n",
      "        -3.2723e-01, -4.4623e+00, -2.0925e-01, -1.7257e-02, -1.0009e+00,\n",
      "        -2.4500e-02, -3.6249e-03, -3.7676e-03, -7.7941e-02, -9.3977e-01,\n",
      "        -4.0629e-01, -2.3964e-01, -3.9193e-03, -4.2100e-02, -1.1766e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.17646076/0.9400000\n",
      "grad_weights: tensor([-6.9467e-02, -1.8438e-02, -1.5479e-01, -1.3825e+00, -1.2313e-01,\n",
      "        -3.2368e-01, -4.4133e+00, -2.0597e-01, -1.7056e-02, -9.8997e-01,\n",
      "        -2.4201e-02, -3.5708e-03, -3.7221e-03, -7.6783e-02, -9.2744e-01,\n",
      "        -4.0188e-01, -2.3675e-01, -3.8708e-03, -4.1473e-02, -1.1635e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.17637725/0.9400000\n",
      "grad_weights: tensor([-6.8763e-02, -1.8229e-02, -1.5282e-01, -1.3640e+00, -1.2188e-01,\n",
      "        -3.2014e-01, -4.3642e+00, -2.0272e-01, -1.6855e-02, -9.7905e-01,\n",
      "        -2.3904e-02, -3.5169e-03, -3.6769e-03, -7.5634e-02, -9.1517e-01,\n",
      "        -3.9746e-01, -2.3386e-01, -3.8224e-03, -4.0852e-02, -1.1504e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.17629461/0.9400000\n",
      "grad_weights: tensor([-6.8066e-02, -1.8022e-02, -1.5086e-01, -1.3457e+00, -1.2065e-01,\n",
      "        -3.1662e-01, -4.3158e+00, -1.9953e-01, -1.6660e-02, -9.6823e-01,\n",
      "        -2.3609e-02, -3.4637e-03, -3.6323e-03, -7.4502e-02, -9.0308e-01,\n",
      "        -3.9307e-01, -2.3099e-01, -3.7744e-03, -4.0240e-02, -1.1375e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.17621286/0.9400000\n",
      "grad_weights: tensor([-6.7349e-02, -1.7815e-02, -1.4887e-01, -1.3271e+00, -1.1937e-01,\n",
      "        -3.1307e-01, -4.2659e+00, -1.9631e-01, -1.6459e-02, -9.5739e-01,\n",
      "        -2.3311e-02, -3.4095e-03, -3.5864e-03, -7.3362e-02, -8.9078e-01,\n",
      "        -3.8873e-01, -2.2808e-01, -3.7264e-03, -3.9623e-02, -1.1243e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.17613198/0.9400000\n",
      "grad_weights: tensor([-6.6652e-02, -1.7609e-02, -1.4694e-01, -1.3091e+00, -1.1813e-01,\n",
      "        -3.0958e-01, -4.2174e+00, -1.9319e-01, -1.6262e-02, -9.4658e-01,\n",
      "        -2.3018e-02, -3.3559e-03, -3.5418e-03, -7.2252e-02, -8.7882e-01,\n",
      "        -3.8435e-01, -2.2523e-01, -3.6788e-03, -3.9022e-02, -1.1115e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.17605202/0.9400000\n",
      "grad_weights: tensor([-6.5956e-02, -1.7405e-02, -1.4502e-01, -1.2912e+00, -1.1690e-01,\n",
      "        -3.0613e-01, -4.1690e+00, -1.9010e-01, -1.6067e-02, -9.3583e-01,\n",
      "        -2.2726e-02, -3.3027e-03, -3.4975e-03, -7.1155e-02, -8.6695e-01,\n",
      "        -3.7998e-01, -2.2239e-01, -3.6312e-03, -3.8428e-02, -1.0987e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 500 | 993 ####, loss/acc = 0.17597295/0.9400000\n",
      "grad_weights: tensor([-6.5267e-02, -1.7201e-02, -1.4312e-01, -1.2734e+00, -1.1567e-01,\n",
      "        -3.0269e-01, -4.1210e+00, -1.8706e-01, -1.5875e-02, -9.2513e-01,\n",
      "        -2.2437e-02, -3.2495e-03, -3.4535e-03, -7.0070e-02, -8.5521e-01,\n",
      "        -3.7563e-01, -2.1957e-01, -3.5841e-03, -3.7841e-02, -1.0860e+00],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> Optimized acc: (tensor(0.8001, device='cuda:1'), 1.0, 0.9)\n",
      "=====> Optimized weights: tensor([0.7852, 0.7849, 0.7845, 0.7843, 0.7852, 0.7850, 0.7850, 0.7836, 0.7848,\n",
      "        0.7850, 0.7846, 0.7836, 0.7845, 0.7839, 0.7844, 0.7850, 0.7847, 0.7844,\n",
      "        0.7838, 0.7849], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-1.7206e-03,  9.2338e-01, -1.9645e-02, -1.3694e-01, -1.0872e-01,\n",
      "        -2.6593e-02, -8.9549e-03, -1.5954e-01, -1.3130e-02, -9.1365e-01,\n",
      "        -1.7786e+00, -1.3585e+00, -3.4311e-02, -5.2687e-01,  1.0369e+00,\n",
      "        -1.5562e-02, -5.6848e+00, -4.6268e-02, -7.3651e-01, -1.5522e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.17660667/0.9400000\n",
      "grad_weights: tensor([-1.6919e-03,  9.1467e-01, -1.9350e-02, -1.3508e-01, -1.0697e-01,\n",
      "        -2.6254e-02, -8.7612e-03, -1.5689e-01, -1.2942e-02, -9.0033e-01,\n",
      "        -1.7543e+00, -1.3394e+00, -3.3694e-02, -5.1887e-01,  1.0287e+00,\n",
      "        -1.5345e-02, -5.5633e+00, -4.5576e-02, -7.2243e-01, -1.5292e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.17649837/0.9400000\n",
      "grad_weights: tensor([-1.6637e-03,  9.0596e-01, -1.9057e-02, -1.3323e-01, -1.0525e-01,\n",
      "        -2.5918e-02, -8.5692e-03, -1.5427e-01, -1.2756e-02, -8.8714e-01,\n",
      "        -1.7301e+00, -1.3205e+00, -3.3085e-02, -5.1095e-01,  1.0203e+00,\n",
      "        -1.5130e-02, -5.4436e+00, -4.4890e-02, -7.0855e-01, -1.5064e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.17639142/0.9400000\n",
      "grad_weights: tensor([-1.6356e-03,  8.9718e-01, -1.8766e-02, -1.3139e-01, -1.0354e-01,\n",
      "        -2.5583e-02, -8.3793e-03, -1.5168e-01, -1.2569e-02, -8.7401e-01,\n",
      "        -1.7060e+00, -1.3016e+00, -3.2482e-02, -5.0308e-01,  1.0119e+00,\n",
      "        -1.4914e-02, -5.3255e+00, -4.4208e-02, -6.9483e-01, -1.4836e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.17628574/0.9400000\n",
      "grad_weights: tensor([-1.6076e-03,  8.8836e-01, -1.8478e-02, -1.2956e-01, -1.0185e-01,\n",
      "        -2.5248e-02, -8.1915e-03, -1.4911e-01, -1.2383e-02, -8.6099e-01,\n",
      "        -1.6821e+00, -1.2828e+00, -3.1887e-02, -4.9528e-01,  1.0034e+00,\n",
      "        -1.4698e-02, -5.2093e+00, -4.3530e-02, -6.8129e-01, -1.4611e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.17618145/0.9400000\n",
      "grad_weights: tensor([-1.5797e-03,  8.7949e-01, -1.8187e-02, -1.2770e-01, -1.0014e-01,\n",
      "        -2.4907e-02, -8.0012e-03, -1.4654e-01, -1.2195e-02, -8.4785e-01,\n",
      "        -1.6578e+00, -1.2639e+00, -3.1294e-02, -4.8739e-01,  9.9480e-01,\n",
      "        -1.4483e-02, -5.0934e+00, -4.2847e-02, -6.6777e-01, -1.4383e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.17607854/0.9400000\n",
      "grad_weights: tensor([-1.5526e-03,  8.7074e-01, -1.7905e-02, -1.2590e-01, -9.8491e-02,\n",
      "        -2.4578e-02, -7.8181e-03, -1.4404e-01, -1.2011e-02, -8.3510e-01,\n",
      "        -1.6343e+00, -1.2454e+00, -3.0716e-02, -4.7974e-01,  9.8616e-01,\n",
      "        -1.4269e-02, -4.9810e+00, -4.2183e-02, -6.5465e-01, -1.4162e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.17597704/0.9400000\n",
      "grad_weights: tensor([-1.5252e-03,  8.6182e-01, -1.7624e-02, -1.2409e-01, -9.6850e-02,\n",
      "        -2.4248e-02, -7.6368e-03, -1.4157e-01, -1.1828e-02, -8.2241e-01,\n",
      "        -1.6107e+00, -1.2271e+00, -3.0145e-02, -4.7216e-01,  9.7741e-01,\n",
      "        -1.4055e-02, -4.8702e+00, -4.1521e-02, -6.4168e-01, -1.3942e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.17587698/0.9400000\n",
      "grad_weights: tensor([-1.4984e-03,  8.5288e-01, -1.7345e-02, -1.2231e-01, -9.5230e-02,\n",
      "        -2.3986e-02, -7.4579e-03, -1.3913e-01, -1.1646e-02, -8.0985e-01,\n",
      "        -1.5874e+00, -1.2089e+00, -2.9582e-02, -4.6465e-01,  9.6857e-01,\n",
      "        -1.3843e-02, -4.7614e+00, -4.0868e-02, -6.2891e-01, -1.3723e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 520 | 993 ####, loss/acc = 0.17577843/0.9400000\n",
      "grad_weights: tensor([-1.4705e-03,  8.4392e-01, -1.7055e-02, -1.2047e-01, -9.3628e-02,\n",
      "        -2.3643e-02, -7.2685e-03, -1.3672e-01, -1.1466e-02, -7.9739e-01,\n",
      "        -1.5629e+00, -1.1909e+00, -2.9027e-02, -4.5681e-01,  9.5880e-01,\n",
      "        -1.3634e-02, -4.6506e+00, -4.0218e-02, -6.1636e-01, -1.3496e+00],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.6997, device='cuda:1'), 0.8, 0.8888888888888888)\n",
      "=====> Optimized weights: tensor([ 0.7254, -0.7278,  0.7263,  0.7267,  0.7261,  0.7269,  0.7242,  0.7259,\n",
      "         0.7264,  0.7265,  0.7267,  0.7266,  0.7255,  0.7263, -0.7282,  0.7265,\n",
      "         0.7245,  0.7263,  0.7252,  0.7264], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-1.9756e-01, -3.0531e-02, -1.0006e-02, -4.1355e-01, -1.3454e-01,\n",
      "        -2.3378e-01, -1.2303e-01, -1.6774e+00, -2.2274e+00,  4.6143e-02,\n",
      "        -2.8852e-01, -2.4309e-02, -7.7702e-03, -1.1129e+00, -1.1620e-01,\n",
      "        -1.4880e-03, -2.0312e-01, -8.9019e-02, -1.3065e-02, -1.2779e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.17665888/0.9400000\n",
      "grad_weights: tensor([-1.9580e-01, -3.0178e-02, -9.8529e-03, -4.1019e-01, -1.3339e-01,\n",
      "        -2.3170e-01, -1.2179e-01, -1.6647e+00, -2.2117e+00,  4.5752e-02,\n",
      "        -2.8549e-01, -2.4101e-02, -7.7026e-03, -1.1037e+00, -1.1524e-01,\n",
      "        -1.4749e-03, -2.0157e-01, -8.8012e-02, -1.2946e-02, -1.2649e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.17660190/0.9400000\n",
      "grad_weights: tensor([-1.9405e-01, -2.9826e-02, -9.7002e-03, -4.0686e-01, -1.3225e-01,\n",
      "        -2.2963e-01, -1.2054e-01, -1.6521e+00, -2.1968e+00,  4.5358e-02,\n",
      "        -2.8248e-01, -2.3894e-02, -7.6357e-03, -1.0945e+00, -1.1428e-01,\n",
      "        -1.4615e-03, -2.0002e-01, -8.7009e-02, -1.2828e-02, -1.2520e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.17654535/0.9400000\n",
      "grad_weights: tensor([-1.9230e-01, -2.9476e-02, -9.5490e-03, -4.0353e-01, -1.3111e-01,\n",
      "        -2.2756e-01, -1.1931e-01, -1.6396e+00, -2.1811e+00,  4.4969e-02,\n",
      "        -2.7950e-01, -2.3687e-02, -7.5683e-03, -1.0853e+00, -1.1333e-01,\n",
      "        -1.4487e-03, -1.9847e-01, -8.6017e-02, -1.2711e-02, -1.2392e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.17648920/0.9400000\n",
      "grad_weights: tensor([-1.9056e-01, -2.9130e-02, -9.3964e-03, -4.0022e-01, -1.2997e-01,\n",
      "        -2.2551e-01, -1.1807e-01, -1.6270e+00, -2.1655e+00,  4.4572e-02,\n",
      "        -2.7653e-01, -2.3482e-02, -7.5016e-03, -1.0762e+00, -1.1238e-01,\n",
      "        -1.4353e-03, -1.9693e-01, -8.5010e-02, -1.2594e-02, -1.2265e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.17643347/0.9400000\n",
      "grad_weights: tensor([-1.8881e-01, -2.8784e-02, -9.2442e-03, -3.9692e-01, -1.2883e-01,\n",
      "        -2.2345e-01, -1.1682e-01, -1.6144e+00, -2.1499e+00,  4.4176e-02,\n",
      "        -2.7359e-01, -2.3277e-02, -7.4359e-03, -1.0671e+00, -1.1142e-01,\n",
      "        -1.4223e-03, -1.9540e-01, -8.4010e-02, -1.2479e-02, -1.2138e-01],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 540 | 993 ####, loss/acc = 0.17637816/0.9400000\n",
      "grad_weights: tensor([-1.8705e-01, -2.8439e-02, -9.0917e-03, -3.9365e-01, -1.2770e-01,\n",
      "        -2.2140e-01, -1.1558e-01, -1.6019e+00, -2.1343e+00,  4.3779e-02,\n",
      "        -2.7068e-01, -2.3073e-02, -7.3697e-03, -1.0580e+00, -1.1047e-01,\n",
      "        -1.4095e-03, -1.9387e-01, -8.3010e-02, -1.2363e-02, -1.2012e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.17632326/0.9400000\n",
      "grad_weights: tensor([-1.8533e-01, -2.8098e-02, -8.9451e-03, -3.9038e-01, -1.2658e-01,\n",
      "        -2.1936e-01, -1.1434e-01, -1.5897e+00, -2.1187e+00,  4.3379e-02,\n",
      "        -2.6778e-01, -2.2870e-02, -7.3038e-03, -1.0489e+00, -1.0952e-01,\n",
      "        -1.3965e-03, -1.9233e-01, -8.2078e-02, -1.2247e-02, -1.1887e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.17626880/0.9400000\n",
      "grad_weights: tensor([-1.8360e-01, -2.7758e-02, -8.7939e-03, -3.8714e-01, -1.2545e-01,\n",
      "        -2.1733e-01, -1.1310e-01, -1.5773e+00, -2.1032e+00,  4.2981e-02,\n",
      "        -2.6491e-01, -2.2668e-02, -7.2383e-03, -1.0399e+00, -1.0858e-01,\n",
      "        -1.3838e-03, -1.9082e-01, -8.1087e-02, -1.2133e-02, -1.1763e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 540 | 993 ####, loss/acc = 0.17621471/0.9400000\n",
      "grad_weights: tensor([-1.8191e-01, -2.7421e-02, -8.6449e-03, -3.8393e-01, -1.2435e-01,\n",
      "        -2.1532e-01, -1.1187e-01, -1.5649e+00, -2.0879e+00,  4.2598e-02,\n",
      "        -2.6208e-01, -2.2469e-02, -7.1739e-03, -1.0309e+00, -1.0767e-01,\n",
      "        -1.3715e-03, -1.8932e-01, -8.0105e-02, -1.2021e-02, -1.1640e-01],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.4998, device='cuda:1'), 0.7, 0.7894736842105263)\n",
      "=====> Optimized weights: tensor([ 0.8103,  0.8095,  0.8082,  0.8106,  0.8104,  0.8103,  0.8099,  0.8107,\n",
      "         0.8109, -0.8104,  0.8099,  0.8104,  0.8103,  0.8105,  0.8105,  0.8098,\n",
      "         0.8107,  0.8096,  0.8102,  0.8100], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.3713, -1.3679, -1.9271, -1.0518, -0.1377, -0.1792, -0.1694,  0.7326,\n",
      "        -0.1269, -0.3794, -0.1054, -0.3492, -0.1759, -0.6610, -2.5882, -0.3881,\n",
      "        -0.0031, -0.0058, -0.1357, -0.8800], device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.17668267/0.9400000\n",
      "grad_weights: tensor([-0.3695, -1.3597, -1.9200, -1.0471, -0.1371, -0.1782, -0.1682,  0.7296,\n",
      "        -0.1262, -0.3776, -0.1048, -0.3475, -0.1750, -0.6582, -2.5752, -0.3860,\n",
      "        -0.0030, -0.0058, -0.1349, -0.8761], device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.17664923/0.9400000\n",
      "grad_weights: tensor([-0.3677, -1.3516, -1.9129, -1.0424, -0.1365, -0.1772, -0.1670,  0.7266,\n",
      "        -0.1255, -0.3759, -0.1042, -0.3459, -0.1742, -0.6553, -2.5623, -0.3840,\n",
      "        -0.0030, -0.0058, -0.1342, -0.8723], device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.17661592/0.9400000\n",
      "grad_weights: tensor([-0.3658, -1.3435, -1.9058, -1.0377, -0.1358, -0.1763, -0.1658,  0.7235,\n",
      "        -0.1248, -0.3741, -0.1036, -0.3442, -0.1734, -0.6525, -2.5494, -0.3819,\n",
      "        -0.0030, -0.0057, -0.1334, -0.8685], device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.17658275/0.9400000\n",
      "grad_weights: tensor([-0.3640, -1.3354, -1.8987, -1.0329, -0.1352, -0.1753, -0.1645,  0.7204,\n",
      "        -0.1241, -0.3724, -0.1030, -0.3426, -0.1726, -0.6496, -2.5364, -0.3798,\n",
      "        -0.0030, -0.0057, -0.1327, -0.8647], device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.17654970/0.9400000\n",
      "grad_weights: tensor([-0.3622, -1.3273, -1.8916, -1.0282, -0.1346, -0.1743, -0.1633,  0.7173,\n",
      "        -0.1234, -0.3707, -0.1024, -0.3409, -0.1717, -0.6468, -2.5236, -0.3778,\n",
      "        -0.0030, -0.0057, -0.1319, -0.8609], device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.17651682/0.9400000\n",
      "grad_weights: tensor([-0.3604, -1.3193, -1.8845, -1.0235, -0.1340, -0.1734, -0.1622,  0.7143,\n",
      "        -0.1227, -0.3689, -0.1018, -0.3393, -0.1709, -0.6439, -2.5108, -0.3757,\n",
      "        -0.0030, -0.0057, -0.1312, -0.8571], device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.17648403/0.9400000\n",
      "grad_weights: tensor([-0.3586, -1.3114, -1.8775, -1.0189, -0.1334, -0.1724, -0.1610,  0.7112,\n",
      "        -0.1220, -0.3672, -0.1012, -0.3377, -0.1701, -0.6412, -2.4981, -0.3737,\n",
      "        -0.0029, -0.0056, -0.1304, -0.8533], device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.17645141/0.9400000\n",
      "grad_weights: tensor([-0.3568, -1.3034, -1.8704, -1.0142, -0.1328, -0.1715, -0.1598,  0.7082,\n",
      "        -0.1213, -0.3655, -0.1006, -0.3361, -0.1693, -0.6383, -2.4853, -0.3717,\n",
      "        -0.0029, -0.0056, -0.1297, -0.8495], device='cuda:1')\n",
      "####Few Shot 560 | 993 ####, loss/acc = 0.17641896/0.9400000\n",
      "grad_weights: tensor([-0.3550, -1.2955, -1.8634, -1.0096, -0.1322, -0.1705, -0.1586,  0.7052,\n",
      "        -0.1206, -0.3638, -0.1000, -0.3344, -0.1685, -0.6355, -2.4726, -0.3697,\n",
      "        -0.0029, -0.0056, -0.1289, -0.8458], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.4000, device='cuda:1'), 0.7, 0.7368421052631579)\n",
      "=====> Optimized weights: tensor([ 0.2859,  0.2858,  0.2860,  0.2860,  0.2860,  0.2859,  0.2857, -0.2860,\n",
      "         0.2859,  0.2860,  0.2858,  0.2859,  0.2859,  0.2860,  0.2859,  0.2859,\n",
      "         0.2858,  0.2859,  0.2859,  0.2860], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-1.9692e-02, -3.5481e-01, -1.0590e-01, -3.8099e-02, -1.3697e-01,\n",
      "        -1.7437e+00, -1.1082e-03, -1.2720e-02, -1.5541e+00, -7.8203e-04,\n",
      "        -1.2608e-01, -2.2610e+00, -5.8473e-02, -1.0504e+00, -1.7735e-01,\n",
      "        -4.3624e-03,  1.1358e+00, -1.1137e+00, -3.4901e-03, -1.5316e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.17662600/0.9400000\n",
      "grad_weights: tensor([-1.9406e-02, -3.5045e-01, -1.0444e-01, -3.7502e-02, -1.3518e-01,\n",
      "        -1.7234e+00, -1.0933e-03, -1.2517e-02, -1.5363e+00, -7.7036e-04,\n",
      "        -1.2436e-01, -2.2331e+00, -5.7729e-02, -1.0360e+00, -1.7480e-01,\n",
      "        -4.3044e-03,  1.1246e+00, -1.1013e+00, -3.4332e-03, -1.5110e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.17653668/0.9400000\n",
      "grad_weights: tensor([-1.9124e-02, -3.4610e-01, -1.0300e-01, -3.6902e-02, -1.3341e-01,\n",
      "        -1.7032e+00, -1.0786e-03, -1.2318e-02, -1.5187e+00, -7.5847e-04,\n",
      "        -1.2263e-01, -2.2053e+00, -5.6984e-02, -1.0215e+00, -1.7227e-01,\n",
      "        -4.2462e-03,  1.1133e+00, -1.0889e+00, -3.3760e-03, -1.4906e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.17644833/0.9400000\n",
      "grad_weights: tensor([-1.8845e-02, -3.4180e-01, -1.0158e-01, -3.6312e-02, -1.3165e-01,\n",
      "        -1.6832e+00, -1.0639e-03, -1.2121e-02, -1.5012e+00, -7.4699e-04,\n",
      "        -1.2090e-01, -2.1779e+00, -5.6248e-02, -1.0073e+00, -1.6979e-01,\n",
      "        -4.1887e-03,  1.1022e+00, -1.0766e+00, -3.3200e-03, -1.4704e+00],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 580 | 993 ####, loss/acc = 0.17636089/0.9400000\n",
      "grad_weights: tensor([-1.8569e-02, -3.3755e-01, -1.0017e-01, -3.5718e-02, -1.2990e-01,\n",
      "        -1.6633e+00, -1.0492e-03, -1.1926e-02, -1.4837e+00, -7.3530e-04,\n",
      "        -1.1921e-01, -2.1507e+00, -5.5515e-02, -9.9326e-01, -1.6730e-01,\n",
      "        -4.1316e-03,  1.0913e+00, -1.0644e+00, -3.2644e-03, -1.4597e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.17627445/0.9400000\n",
      "grad_weights: tensor([-1.8294e-02, -3.3328e-01, -9.8765e-02, -3.5124e-02, -1.2816e-01,\n",
      "        -1.6433e+00, -1.0344e-03, -1.1733e-02, -1.4662e+00, -7.2368e-04,\n",
      "        -1.1750e-01, -2.1234e+00, -5.4783e-02, -9.7913e-01, -1.6484e-01,\n",
      "        -4.0744e-03,  1.0800e+00, -1.0521e+00, -3.2098e-03, -1.4396e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.17618901/0.9400000\n",
      "grad_weights: tensor([-1.8023e-02, -3.2905e-01, -9.7375e-02, -3.4535e-02, -1.2643e-01,\n",
      "        -1.6235e+00, -1.0198e-03, -1.1542e-02, -1.4490e+00, -7.1213e-04,\n",
      "        -1.1580e-01, -2.0963e+00, -5.4056e-02, -9.6515e-01, -1.6239e-01,\n",
      "        -4.0175e-03,  1.0687e+00, -1.0399e+00, -3.1555e-03, -1.4196e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.17610450/0.9400000\n",
      "grad_weights: tensor([-1.7749e-02, -3.2482e-01, -9.5978e-02, -3.3968e-02, -1.2469e-01,\n",
      "        -1.6034e+00, -9.9947e-04, -1.1351e-02, -1.4313e+00, -7.0068e-04,\n",
      "        -1.1411e-01, -2.0688e+00, -5.3325e-02, -9.5130e-01, -1.5993e-01,\n",
      "        -3.9602e-03,  1.0576e+00, -1.0279e+00, -3.1014e-03, -1.3994e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.17602108/0.9400000\n",
      "grad_weights: tensor([-1.7483e-02, -3.2064e-01, -9.4614e-02, -3.3383e-02, -1.2299e-01,\n",
      "        -1.5838e+00, -9.8507e-04, -1.1164e-02, -1.4141e+00, -6.8932e-04,\n",
      "        -1.1242e-01, -2.0421e+00, -5.2610e-02, -9.3753e-01, -1.5754e-01,\n",
      "        -3.9036e-03,  1.0463e+00, -1.0158e+00, -3.0486e-03, -1.3797e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 580 | 993 ####, loss/acc = 0.17593868/0.9400000\n",
      "grad_weights: tensor([-1.7220e-02, -3.1650e-01, -9.3264e-02, -3.2800e-02, -1.2131e-01,\n",
      "        -1.5642e+00, -9.7072e-04, -1.0978e-02, -1.3970e+00, -6.7790e-04,\n",
      "        -1.1074e-01, -2.0155e+00, -5.1899e-02, -9.2387e-01, -1.5517e-01,\n",
      "        -3.8480e-03,  1.0351e+00, -1.0037e+00, -2.9965e-03, -1.3602e+00],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.3998, device='cuda:1'), 0.6, 0.7368421052631579)\n",
      "=====> Optimized weights: tensor([ 0.7890,  0.7897,  0.7893,  0.7886,  0.7895,  0.7899,  0.7885,  0.7886,\n",
      "         0.7900,  0.7878,  0.7892,  0.7897,  0.7895,  0.7893,  0.7891,  0.7892,\n",
      "        -0.7904,  0.7900,  0.7882,  0.7897], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87]\n",
      "reset tmp model\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.8, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.6541, -0.1549, -0.0279, -1.5493, -0.0079, -0.1015, -0.0269, -0.1630,\n",
      "        -0.3591, -0.4722, -1.1549, -0.7425, -0.0790, -1.7002, -0.1387, -0.0315,\n",
      "        -0.4074, -0.0027, -0.1267, -0.0227], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.17665924/0.9400000\n",
      "grad_weights: tensor([-0.6488, -0.1531, -0.0276, -1.5369, -0.0079, -0.1006, -0.0266, -0.1614,\n",
      "        -0.3557, -0.4681, -1.1452, -0.7360, -0.0781, -1.6853, -0.1370, -0.0312,\n",
      "        -0.4033, -0.0026, -0.1257, -0.0225], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.17660275/0.9400000\n",
      "grad_weights: tensor([-0.6435, -0.1514, -0.0274, -1.5245, -0.0078, -0.0998, -0.0264, -0.1599,\n",
      "        -0.3523, -0.4640, -1.1356, -0.7295, -0.0773, -1.6704, -0.1353, -0.0310,\n",
      "        -0.3992, -0.0026, -0.1247, -0.0222], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.17654663/0.9400000\n",
      "grad_weights: tensor([-0.6382, -0.1496, -0.0271, -1.5121, -0.0077, -0.0989, -0.0261, -0.1583,\n",
      "        -0.3489, -0.4599, -1.1259, -0.7230, -0.0765, -1.6556, -0.1337, -0.0308,\n",
      "        -0.3950, -0.0026, -0.1237, -0.0220], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.17649093/0.9400000\n",
      "grad_weights: tensor([-0.6329, -0.1479, -0.0269, -1.4997, -0.0076, -0.0980, -0.0259, -0.1568,\n",
      "        -0.3456, -0.4558, -1.1163, -0.7165, -0.0756, -1.6409, -0.1320, -0.0305,\n",
      "        -0.3909, -0.0026, -0.1226, -0.0218], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.17643569/0.9400000\n",
      "grad_weights: tensor([-0.6276, -0.1462, -0.0266, -1.4875, -0.0076, -0.0972, -0.0257, -0.1553,\n",
      "        -0.3423, -0.4518, -1.1069, -0.7102, -0.0748, -1.6263, -0.1304, -0.0303,\n",
      "        -0.3868, -0.0025, -0.1216, -0.0216], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.17638089/0.9400000\n",
      "grad_weights: tensor([-0.6223, -0.1445, -0.0264, -1.4752, -0.0075, -0.0964, -0.0254, -0.1537,\n",
      "        -0.3389, -0.4477, -1.0974, -0.7038, -0.0740, -1.6117, -0.1288, -0.0301,\n",
      "        -0.3827, -0.0025, -0.1206, -0.0214], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.17632650/0.9400000\n",
      "grad_weights: tensor([-0.6171, -0.1429, -0.0261, -1.4630, -0.0074, -0.0955, -0.0252, -0.1523,\n",
      "        -0.3357, -0.4437, -1.0881, -0.6975, -0.0732, -1.5973, -0.1272, -0.0299,\n",
      "        -0.3787, -0.0025, -0.1196, -0.0212], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.17627260/0.9400000\n",
      "grad_weights: tensor([-0.6119, -0.1412, -0.0259, -1.4508, -0.0073, -0.0947, -0.0250, -0.1508,\n",
      "        -0.3323, -0.4397, -1.0787, -0.6911, -0.0724, -1.5829, -0.1257, -0.0296,\n",
      "        -0.3746, -0.0025, -0.1187, -0.0210], device='cuda:1')\n",
      "####Few Shot 600 | 993 ####, loss/acc = 0.17621917/0.9400000\n",
      "grad_weights: tensor([-0.6067, -0.1396, -0.0256, -1.4386, -0.0073, -0.0938, -0.0247, -0.1493,\n",
      "        -0.3290, -0.4357, -1.0693, -0.6849, -0.0716, -1.5686, -0.1241, -0.0294,\n",
      "        -0.3705, -0.0025, -0.1177, -0.0208], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> Optimized weights: tensor([0.7191, 0.7183, 0.7189, 0.7192, 0.7187, 0.7190, 0.7189, 0.7188, 0.7188,\n",
      "        0.7190, 0.7191, 0.7190, 0.7185, 0.7190, 0.7181, 0.7193, 0.7186, 0.7187,\n",
      "        0.7191, 0.7187], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169]\n",
      "=====> init acc: (tensor(0.8000, device='cuda:1'), 0.9, 0.9)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.7294, -1.5047, -0.1641, -0.3558, -0.7846, -0.0137, -0.9711, -3.5274,\n",
      "        -0.1029, -0.0221, -0.0275, -0.0996, -1.0976, -1.4729, -0.0183, -4.0766,\n",
      "        -0.3925, -0.0369, -0.0560, -0.2999], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.17666386/0.9400000\n",
      "grad_weights: tensor([-0.7225, -1.4943, -0.1628, -0.3529, -0.7796, -0.0136, -0.9634, -3.4926,\n",
      "        -0.1021, -0.0219, -0.0273, -0.0989, -1.0898, -1.4612, -0.0182, -4.0364,\n",
      "        -0.3897, -0.0367, -0.0555, -0.2975], device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 620 | 993 ####, loss/acc = 0.17661171/0.9400000\n",
      "grad_weights: tensor([-0.7157, -1.4839, -0.1615, -0.3501, -0.7746, -0.0136, -0.9558, -3.4580,\n",
      "        -0.1013, -0.0217, -0.0271, -0.0982, -1.0820, -1.4495, -0.0181, -3.9965,\n",
      "        -0.3870, -0.0364, -0.0550, -0.2952], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.17655993/0.9400000\n",
      "grad_weights: tensor([-0.7087, -1.4735, -0.1602, -0.3473, -0.7696, -0.0135, -0.9483, -3.4236,\n",
      "        -0.1005, -0.0215, -0.0269, -0.0975, -1.0742, -1.4379, -0.0180, -3.9568,\n",
      "        -0.3843, -0.0361, -0.0546, -0.2928], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.17650844/0.9400000\n",
      "grad_weights: tensor([-0.7020, -1.4633, -0.1589, -0.3446, -0.7647, -0.0134, -0.9408, -3.3896,\n",
      "        -0.0998, -0.0214, -0.0267, -0.0968, -1.0665, -1.4264, -0.0179, -3.9176,\n",
      "        -0.3815, -0.0359, -0.0541, -0.2905], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.17645726/0.9400000\n",
      "grad_weights: tensor([-0.6953, -1.4530, -0.1576, -0.3418, -0.7597, -0.0133, -0.9333, -3.3556,\n",
      "        -0.0990, -0.0212, -0.0265, -0.0961, -1.0588, -1.4148, -0.0177, -3.8786,\n",
      "        -0.3788, -0.0356, -0.0536, -0.2882], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.17640644/0.9400000\n",
      "grad_weights: tensor([-0.6886, -1.4427, -0.1564, -0.3391, -0.7548, -0.0132, -0.9258, -3.3220,\n",
      "        -0.0982, -0.0210, -0.0263, -0.0954, -1.0511, -1.4034, -0.0176, -3.8398,\n",
      "        -0.3761, -0.0354, -0.0532, -0.2859], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.17635590/0.9400000\n",
      "grad_weights: tensor([-0.6820, -1.4325, -0.1551, -0.3363, -0.7499, -0.0131, -0.9184, -3.2885,\n",
      "        -0.0974, -0.0208, -0.0262, -0.0947, -1.0435, -1.3920, -0.0175, -3.8013,\n",
      "        -0.3734, -0.0351, -0.0527, -0.2836], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.17630571/0.9400000\n",
      "grad_weights: tensor([-0.6754, -1.4223, -0.1539, -0.3336, -0.7449, -0.0130, -0.9110, -3.2553,\n",
      "        -0.0967, -0.0206, -0.0260, -0.0940, -1.0359, -1.3806, -0.0174, -3.7631,\n",
      "        -0.3707, -0.0349, -0.0523, -0.2813], device='cuda:1')\n",
      "####Few Shot 620 | 993 ####, loss/acc = 0.17625588/0.9400000\n",
      "grad_weights: tensor([-0.6689, -1.4123, -0.1527, -0.3309, -0.7401, -0.0129, -0.9037, -3.2226,\n",
      "        -0.0959, -0.0205, -0.0258, -0.0934, -1.0284, -1.3694, -0.0172, -3.7255,\n",
      "        -0.3680, -0.0346, -0.0518, -0.2790], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.8000, device='cuda:1'), 0.9, 0.9)\n",
      "=====> Optimized weights: tensor([0.3324, 0.3327, 0.3326, 0.3326, 0.3327, 0.3327, 0.3326, 0.3323, 0.3326,\n",
      "        0.3325, 0.3327, 0.3327, 0.3327, 0.3326, 0.3327, 0.3323, 0.3327, 0.3327,\n",
      "        0.3325, 0.3326], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.6, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-4.0013e-01, -3.4616e-01, -1.8645e+00, -3.8866e-03, -3.0914e+00,\n",
      "        -4.6766e-01, -1.6638e+00, -5.1362e-01, -1.3832e-01, -4.4686e+00,\n",
      "        -2.6477e-02, -1.8505e-01, -3.3793e-02, -6.9951e-03, -1.1200e+00,\n",
      "        -3.6646e-03, -1.4339e+00, -2.0215e+00, -6.3993e-02, -1.2931e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.17666847/0.9400000\n",
      "grad_weights: tensor([-3.9769e-01, -3.4360e-01, -1.8502e+00, -3.8600e-03, -3.0651e+00,\n",
      "        -4.6421e-01, -1.6526e+00, -5.0930e-01, -1.3722e-01, -4.4261e+00,\n",
      "        -2.6292e-02, -1.8380e-01, -3.3592e-02, -6.9432e-03, -1.1131e+00,\n",
      "        -3.6406e-03, -1.4236e+00, -2.0064e+00, -6.3616e-02, -1.2846e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.17662096/0.9400000\n",
      "grad_weights: tensor([-3.9527e-01, -3.4105e-01, -1.8363e+00, -3.8337e-03, -3.0390e+00,\n",
      "        -4.6079e-01, -1.6413e+00, -5.0502e-01, -1.3612e-01, -4.3839e+00,\n",
      "        -2.6107e-02, -1.8257e-01, -3.3393e-02, -6.8920e-03, -1.1062e+00,\n",
      "        -3.6168e-03, -1.4134e+00, -1.9914e+00, -6.3239e-02, -1.2761e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.17657374/0.9400000\n",
      "grad_weights: tensor([-3.9285e-01, -3.3851e-01, -1.8225e+00, -3.8071e-03, -3.0131e+00,\n",
      "        -4.5737e-01, -1.6301e+00, -5.0075e-01, -1.3503e-01, -4.3420e+00,\n",
      "        -2.5922e-02, -1.8133e-01, -3.3192e-02, -6.8407e-03, -1.0993e+00,\n",
      "        -3.5930e-03, -1.4033e+00, -1.9764e+00, -6.2864e-02, -1.2677e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.17652674/0.9400000\n",
      "grad_weights: tensor([-3.9046e-01, -3.3599e-01, -1.8087e+00, -3.7809e-03, -2.9874e+00,\n",
      "        -4.5398e-01, -1.6190e+00, -4.9653e-01, -1.3394e-01, -4.3004e+00,\n",
      "        -2.5739e-02, -1.8011e-01, -3.2993e-02, -6.7898e-03, -1.0924e+00,\n",
      "        -3.5695e-03, -1.3932e+00, -1.9614e+00, -6.2489e-02, -1.2593e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.17648003/0.9400000\n",
      "grad_weights: tensor([-3.8805e-01, -3.3348e-01, -1.7950e+00, -3.7544e-03, -2.9618e+00,\n",
      "        -4.5060e-01, -1.6079e+00, -4.9232e-01, -1.3286e-01, -4.2591e+00,\n",
      "        -2.5555e-02, -1.7888e-01, -3.2793e-02, -6.7387e-03, -1.0855e+00,\n",
      "        -3.5457e-03, -1.3831e+00, -1.9465e+00, -6.2115e-02, -1.2509e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.17643358/0.9400000\n",
      "grad_weights: tensor([-3.8566e-01, -3.3098e-01, -1.7814e+00, -3.7279e-03, -2.9364e+00,\n",
      "        -4.4723e-01, -1.5968e+00, -4.8813e-01, -1.3178e-01, -4.2180e+00,\n",
      "        -2.5371e-02, -1.7765e-01, -3.2593e-02, -6.6881e-03, -1.0787e+00,\n",
      "        -3.5221e-03, -1.3731e+00, -1.9316e+00, -6.1741e-02, -1.2426e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.17638740/0.9400000\n",
      "grad_weights: tensor([-3.8327e-01, -3.2849e-01, -1.7678e+00, -3.7015e-03, -2.9111e+00,\n",
      "        -4.4388e-01, -1.5858e+00, -4.8397e-01, -1.3071e-01, -4.1772e+00,\n",
      "        -2.5187e-02, -1.7642e-01, -3.2394e-02, -6.6376e-03, -1.0718e+00,\n",
      "        -3.4985e-03, -1.3631e+00, -1.9167e+00, -6.1368e-02, -1.2343e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.17634152/0.9400000\n",
      "grad_weights: tensor([-3.8089e-01, -3.2601e-01, -1.7543e+00, -3.6751e-03, -2.8859e+00,\n",
      "        -4.4054e-01, -1.5748e+00, -4.7984e-01, -1.2965e-01, -4.1368e+00,\n",
      "        -2.5004e-02, -1.7520e-01, -3.2195e-02, -6.5877e-03, -1.0650e+00,\n",
      "        -3.4750e-03, -1.3532e+00, -1.9018e+00, -6.0996e-02, -1.2260e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 640 | 993 ####, loss/acc = 0.17629591/0.9400000\n",
      "grad_weights: tensor([-3.7853e-01, -3.2355e-01, -1.7409e+00, -3.6488e-03, -2.8610e+00,\n",
      "        -4.3723e-01, -1.5638e+00, -4.7574e-01, -1.2860e-01, -4.0967e+00,\n",
      "        -2.4820e-02, -1.7398e-01, -3.1996e-02, -6.5382e-03, -1.0582e+00,\n",
      "        -3.4515e-03, -1.3433e+00, -1.8871e+00, -6.0624e-02, -1.2178e+00],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.4000, device='cuda:1'), 0.6, 0.7)\n",
      "=====> Optimized weights: tensor([0.2494, 0.2493, 0.2493, 0.2493, 0.2492, 0.2493, 0.2494, 0.2492, 0.2492,\n",
      "        0.2491, 0.2493, 0.2494, 0.2494, 0.2493, 0.2494, 0.2493, 0.2493, 0.2493,\n",
      "        0.2494, 0.2494], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 1.0, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 660 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-3.6591e-01, -4.5688e-02, -3.9723e+00, -4.5476e+00, -1.1773e-01,\n",
      "        -1.5623e+00, -3.7343e-01, -1.6133e+00, -1.9308e-02, -2.7615e-03,\n",
      "        -1.0113e+00, -3.8887e-01, -1.6750e+00, -7.1744e-01, -1.0821e+00,\n",
      "        -9.7389e-01, -2.8741e+00, -4.8724e-01, -3.6834e-01, -1.8510e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.17668273/0.9400000\n",
      "grad_weights: tensor([-3.6380e-01, -4.5485e-02, -3.9544e+00, -4.5308e+00, -1.1717e-01,\n",
      "        -1.5550e+00, -3.7140e-01, -1.6064e+00, -1.9219e-02, -2.7484e-03,\n",
      "        -1.0069e+00, -3.8717e-01, -1.6662e+00, -7.1387e-01, -1.0773e+00,\n",
      "        -9.6943e-01, -2.8627e+00, -4.8523e-01, -3.6656e-01, -1.8428e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.17664938/0.9400000\n",
      "grad_weights: tensor([-3.6172e-01, -4.5283e-02, -3.9367e+00, -4.5141e+00, -1.1661e-01,\n",
      "        -1.5477e+00, -3.6939e-01, -1.5996e+00, -1.9131e-02, -2.7353e-03,\n",
      "        -1.0026e+00, -3.8547e-01, -1.6574e+00, -7.1041e-01, -1.0725e+00,\n",
      "        -9.6498e-01, -2.8513e+00, -4.8323e-01, -3.6480e-01, -1.8346e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.17661613/0.9400000\n",
      "grad_weights: tensor([-3.5964e-01, -4.5080e-02, -3.9189e+00, -4.4974e+00, -1.1606e-01,\n",
      "        -1.5405e+00, -3.6738e-01, -1.5927e+00, -1.9043e-02, -2.7223e-03,\n",
      "        -9.9819e-01, -3.8377e-01, -1.6487e+00, -7.0694e-01, -1.0677e+00,\n",
      "        -9.6053e-01, -2.8400e+00, -4.8123e-01, -3.6303e-01, -1.8264e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.17658301/0.9400000\n",
      "grad_weights: tensor([-3.5756e-01, -4.4879e-02, -3.9012e+00, -4.4806e+00, -1.1550e-01,\n",
      "        -1.5332e+00, -3.6537e-01, -1.5858e+00, -1.8955e-02, -2.7093e-03,\n",
      "        -9.9382e-01, -3.8208e-01, -1.6399e+00, -7.0348e-01, -1.0629e+00,\n",
      "        -9.5610e-01, -2.8286e+00, -4.7923e-01, -3.6126e-01, -1.8182e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.17655005/0.9400000\n",
      "grad_weights: tensor([-3.5549e-01, -4.4677e-02, -3.8835e+00, -4.4639e+00, -1.1495e-01,\n",
      "        -1.5260e+00, -3.6337e-01, -1.5789e+00, -1.8868e-02, -2.6963e-03,\n",
      "        -9.8946e-01, -3.8038e-01, -1.6312e+00, -7.0004e-01, -1.0582e+00,\n",
      "        -9.5168e-01, -2.8173e+00, -4.7724e-01, -3.5951e-01, -1.8101e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.17651719/0.9400000\n",
      "grad_weights: tensor([-3.5344e-01, -4.4476e-02, -3.8658e+00, -4.4472e+00, -1.1440e-01,\n",
      "        -1.5187e+00, -3.6138e-01, -1.5721e+00, -1.8781e-02, -2.6832e-03,\n",
      "        -9.8511e-01, -3.7870e-01, -1.6225e+00, -6.9660e-01, -1.0534e+00,\n",
      "        -9.4726e-01, -2.8060e+00, -4.7526e-01, -3.5775e-01, -1.8020e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.17648441/0.9400000\n",
      "grad_weights: tensor([-3.5140e-01, -4.4277e-02, -3.8483e+00, -4.4307e+00, -1.1385e-01,\n",
      "        -1.5116e+00, -3.5942e-01, -1.5653e+00, -1.8694e-02, -2.6701e-03,\n",
      "        -9.8076e-01, -3.7702e-01, -1.6139e+00, -6.9320e-01, -1.0487e+00,\n",
      "        -9.4290e-01, -2.7948e+00, -4.7329e-01, -3.5602e-01, -1.7939e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.17645182/0.9400000\n",
      "grad_weights: tensor([-3.4936e-01, -4.4077e-02, -3.8307e+00, -4.4140e+00, -1.1330e-01,\n",
      "        -1.5044e+00, -3.5744e-01, -1.5585e+00, -1.8608e-02, -2.6571e-03,\n",
      "        -9.7641e-01, -3.7534e-01, -1.6053e+00, -6.8979e-01, -1.0439e+00,\n",
      "        -9.3850e-01, -2.7835e+00, -4.7131e-01, -3.5427e-01, -1.7858e+00],\n",
      "       device='cuda:1')\n",
      "####Few Shot 660 | 993 ####, loss/acc = 0.17641933/0.9400000\n",
      "grad_weights: tensor([-3.4733e-01, -4.3878e-02, -3.8132e+00, -4.3974e+00, -1.1275e-01,\n",
      "        -1.4972e+00, -3.5548e-01, -1.5517e+00, -1.8521e-02, -2.6440e-03,\n",
      "        -9.7207e-01, -3.7366e-01, -1.5968e+00, -6.8639e-01, -1.0392e+00,\n",
      "        -9.3413e-01, -2.7723e+00, -4.6934e-01, -3.5254e-01, -1.7778e+00],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.7000, device='cuda:1'), 0.7, 0.85)\n",
      "=====> Optimized weights: tensor([0.1391, 0.1392, 0.1392, 0.1392, 0.1392, 0.1392, 0.1391, 0.1392, 0.1392,\n",
      "        0.1391, 0.1392, 0.1392, 0.1391, 0.1392, 0.1392, 0.1392, 0.1392, 0.1392,\n",
      "        0.1392, 0.1392], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.9, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.0449, -0.0385,  1.7453, -0.0161, -0.3182, -0.0106, -0.2025, -0.1436,\n",
      "        -0.6716, -0.0252, -0.6885, -0.0808, -0.2151, -0.0774, -0.0504, -0.0053,\n",
      "        -0.8168, -3.3179, -0.3551, -0.0399], device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.17660709/0.9400000\n",
      "grad_weights: tensor([-0.0441, -0.0379,  1.7325, -0.0158, -0.3135, -0.0104, -0.1989, -0.1418,\n",
      "        -0.6603, -0.0249, -0.6755, -0.0794, -0.2110, -0.0761, -0.0496, -0.0052,\n",
      "        -0.8050, -3.2724, -0.3501, -0.0392], device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.17649929/0.9400000\n",
      "grad_weights: tensor([-0.0433, -0.0373,  1.7194, -0.0155, -0.3088, -0.0102, -0.1954, -0.1400,\n",
      "        -0.6492, -0.0245, -0.6627, -0.0781, -0.2068, -0.0747, -0.0488, -0.0051,\n",
      "        -0.7932, -3.2270, -0.3450, -0.0385], device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.17639278/0.9400000\n",
      "grad_weights: tensor([-0.0426, -0.0367,  1.7064, -0.0152, -0.3041, -0.0100, -0.1919, -0.1382,\n",
      "        -0.6381, -0.0242, -0.6500, -0.0768, -0.2027, -0.0733, -0.0480, -0.0050,\n",
      "        -0.7816, -3.1820, -0.3401, -0.0378], device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.17628764/0.9400000\n",
      "grad_weights: tensor([-0.0418, -0.0360,  1.6933, -0.0149, -0.2995, -0.0099, -0.1884, -0.1364,\n",
      "        -0.6271, -0.0239, -0.6375, -0.0756, -0.1987, -0.0720, -0.0472, -0.0050,\n",
      "        -0.7700, -3.1371, -0.3351, -0.0372], device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.17618389/0.9400000\n",
      "grad_weights: tensor([-0.0410, -0.0354,  1.6801, -0.0147, -0.2950, -0.0097, -0.1849, -0.1346,\n",
      "        -0.6162, -0.0236, -0.6252, -0.0743, -0.1947, -0.0706, -0.0465, -0.0049,\n",
      "        -0.7586, -3.0924, -0.3302, -0.0365], device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.17608152/0.9400000\n",
      "grad_weights: tensor([-0.0402, -0.0348,  1.6667, -0.0144, -0.2905, -0.0095, -0.1815, -0.1329,\n",
      "        -0.6053, -0.0233, -0.6130, -0.0730, -0.1908, -0.0693, -0.0457, -0.0048,\n",
      "        -0.7472, -3.0479, -0.3254, -0.0359], device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.17598061/0.9400000\n",
      "grad_weights: tensor([-0.0395, -0.0342,  1.6531, -0.0141, -0.2860, -0.0094, -0.1781, -0.1311,\n",
      "        -0.5946, -0.0230, -0.6010, -0.0718, -0.1869, -0.0680, -0.0449, -0.0047,\n",
      "        -0.7358, -3.0036, -0.3205, -0.0352], device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.17588109/0.9400000\n",
      "grad_weights: tensor([-0.0387, -0.0336,  1.6390, -0.0138, -0.2815, -0.0092, -0.1747, -0.1293,\n",
      "        -0.5838, -0.0227, -0.5890, -0.0705, -0.1831, -0.0667, -0.0441, -0.0046,\n",
      "        -0.7246, -2.9596, -0.3157, -0.0346], device='cuda:1')\n",
      "####Few Shot 680 | 993 ####, loss/acc = 0.17578310/0.9400000\n",
      "grad_weights: tensor([-0.0379, -0.0330,  1.6253, -0.0136, -0.2771, -0.0090, -0.1712, -0.1275,\n",
      "        -0.5728, -0.0224, -0.5769, -0.0692, -0.1792, -0.0654, -0.0433, -0.0046,\n",
      "        -0.7135, -2.9133, -0.3107, -0.0339], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.5999, device='cuda:1'), 0.6, 0.7894736842105263)\n",
      "=====> Optimized weights: tensor([ 1.2303,  1.2309, -1.2351,  1.2302,  1.2318,  1.2306,  1.2303,  1.2328,\n",
      "         1.2308,  1.2328,  1.2298,  1.2310,  1.2295,  1.2302,  1.2312,  1.2313,\n",
      "         1.2319,  1.2322,  1.2320,  1.2305], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.8, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 700 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-1.1012e-01, -4.8014e-01, -6.1827e-01, -3.3383e-01, -4.7883e-01,\n",
      "         6.5431e-02, -2.1676e-01, -1.6594e+00, -1.0153e+00, -1.7162e+00,\n",
      "        -1.5377e-01, -1.4677e-01, -5.6462e-01, -4.9157e-02, -1.1209e-03,\n",
      "        -1.2094e-01, -8.8072e-01, -4.9264e-02, -6.4327e-02, -2.3133e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.17667498/0.9400000\n",
      "grad_weights: tensor([-1.0948e-01, -4.7766e-01, -6.1309e-01, -3.3168e-01, -4.7628e-01,\n",
      "         6.5149e-02, -2.1552e-01, -1.6507e+00, -1.0092e+00, -1.7053e+00,\n",
      "        -1.5278e-01, -1.4610e-01, -5.6060e-01, -4.8862e-02, -1.1148e-03,\n",
      "        -1.2012e-01, -8.7561e-01, -4.8972e-02, -6.3998e-02, -2.2997e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.17663392/0.9400000\n",
      "grad_weights: tensor([-1.0885e-01, -4.7521e-01, -6.0794e-01, -3.2954e-01, -4.7375e-01,\n",
      "         6.4869e-02, -2.1428e-01, -1.6419e+00, -1.0031e+00, -1.6944e+00,\n",
      "        -1.5180e-01, -1.4542e-01, -5.5662e-01, -4.8569e-02, -1.1087e-03,\n",
      "        -1.1931e-01, -8.7054e-01, -4.8682e-02, -6.3670e-02, -2.2863e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.17659305/0.9400000\n",
      "grad_weights: tensor([-1.0821e-01, -4.7273e-01, -6.0283e-01, -3.2741e-01, -4.7122e-01,\n",
      "         6.4587e-02, -2.1304e-01, -1.6332e+00, -9.9702e-01, -1.6836e+00,\n",
      "        -1.5081e-01, -1.4475e-01, -5.5264e-01, -4.8276e-02, -1.1024e-03,\n",
      "        -1.1849e-01, -8.6547e-01, -4.8392e-02, -6.3342e-02, -2.2728e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.17655236/0.9400000\n",
      "grad_weights: tensor([-1.0758e-01, -4.7027e-01, -5.9775e-01, -3.2528e-01, -4.6870e-01,\n",
      "         6.4304e-02, -2.1180e-01, -1.6245e+00, -9.9095e-01, -1.6728e+00,\n",
      "        -1.4982e-01, -1.4407e-01, -5.4869e-01, -4.7984e-02, -1.0964e-03,\n",
      "        -1.1769e-01, -8.6042e-01, -4.8103e-02, -6.3014e-02, -2.2594e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.17651190/0.9400000\n",
      "grad_weights: tensor([-1.0695e-01, -4.6781e-01, -5.9273e-01, -3.2318e-01, -4.6620e-01,\n",
      "         6.4022e-02, -2.1058e-01, -1.6159e+00, -9.8494e-01, -1.6621e+00,\n",
      "        -1.4883e-01, -1.4340e-01, -5.4479e-01, -4.7695e-02, -1.0902e-03,\n",
      "        -1.1689e-01, -8.5542e-01, -4.7816e-02, -6.2689e-02, -2.2461e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.17647164/0.9400000\n",
      "grad_weights: tensor([-1.0632e-01, -4.6535e-01, -5.8772e-01, -3.2108e-01, -4.6369e-01,\n",
      "         6.3739e-02, -2.0935e-01, -1.6072e+00, -9.7892e-01, -1.6514e+00,\n",
      "        -1.4784e-01, -1.4273e-01, -5.4088e-01, -4.7406e-02, -1.0841e-03,\n",
      "        -1.1609e-01, -8.5041e-01, -4.7529e-02, -6.2363e-02, -2.2328e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.17643154/0.9400000\n",
      "grad_weights: tensor([-1.0569e-01, -4.6290e-01, -5.8274e-01, -3.1898e-01, -4.6119e-01,\n",
      "         6.3456e-02, -2.0813e-01, -1.5986e+00, -9.7293e-01, -1.6408e+00,\n",
      "        -1.4685e-01, -1.4206e-01, -5.3700e-01, -4.7119e-02, -1.0780e-03,\n",
      "        -1.1529e-01, -8.4541e-01, -4.7243e-02, -6.2037e-02, -2.2195e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.17639166/0.9400000\n",
      "grad_weights: tensor([-1.0507e-01, -4.6043e-01, -5.7780e-01, -3.1690e-01, -4.5870e-01,\n",
      "         6.3171e-02, -2.0690e-01, -1.5900e+00, -9.6695e-01, -1.6302e+00,\n",
      "        -1.4586e-01, -1.4138e-01, -5.3313e-01, -4.6832e-02, -1.0719e-03,\n",
      "        -1.1450e-01, -8.4043e-01, -4.6958e-02, -6.1712e-02, -2.2063e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 700 | 993 ####, loss/acc = 0.17635198/0.9400000\n",
      "grad_weights: tensor([-1.0444e-01, -4.5799e-01, -5.7290e-01, -3.1482e-01, -4.5621e-01,\n",
      "         6.2888e-02, -2.0568e-01, -1.5814e+00, -9.6101e-01, -1.6196e+00,\n",
      "        -1.4488e-01, -1.4071e-01, -5.2929e-01, -4.6547e-02, -1.0658e-03,\n",
      "        -1.1371e-01, -8.3548e-01, -4.6675e-02, -6.1387e-02, -2.1931e-01],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.5000, device='cuda:1'), 1.0, 0.7894736842105263)\n",
      "=====> Optimized weights: tensor([ 0.4604,  0.4605,  0.4600,  0.4603,  0.4605, -0.4607,  0.4605,  0.4605,\n",
      "         0.4604,  0.4604,  0.4603,  0.4606,  0.4602,  0.4604,  0.4601,  0.4603,\n",
      "         0.4604,  0.4604,  0.4605,  0.4604], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.9, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-5.4238e-02, -1.7744e+00, -1.0824e+00, -2.3815e+00,  4.9177e-01,\n",
      "         2.6477e+00, -1.5587e-02, -2.0083e-01, -2.0710e-02, -1.8786e-02,\n",
      "        -1.1409e+00, -1.5392e-03, -1.5098e-01, -9.6315e-03, -6.3682e-02,\n",
      "        -1.7436e+00, -5.1590e-02, -1.5641e-01,  2.3967e+00, -2.4016e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.17662308/0.9400000\n",
      "grad_weights: tensor([-5.3586e-02, -1.7444e+00, -1.0683e+00, -2.3509e+00,  4.8712e-01,\n",
      "         2.6274e+00, -1.5389e-02, -1.9785e-01, -2.0465e-02, -1.8572e-02,\n",
      "        -1.1260e+00, -1.5195e-03, -1.4910e-01, -9.5203e-03, -6.2725e-02,\n",
      "        -1.7244e+00, -5.0948e-02, -1.5324e-01,  2.3851e+00, -2.3695e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.17653078/0.9400000\n",
      "grad_weights: tensor([-5.2937e-02, -1.7147e+00, -1.0543e+00, -2.3204e+00,  4.8246e-01,\n",
      "         2.6072e+00, -1.5193e-02, -1.9491e-01, -2.0222e-02, -1.8359e-02,\n",
      "        -1.1112e+00, -1.4999e-03, -1.4723e-01, -9.4100e-03, -6.1776e-02,\n",
      "        -1.7049e+00, -5.0311e-02, -1.5013e-01,  2.3734e+00, -2.3376e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.17643948/0.9400000\n",
      "grad_weights: tensor([-5.2290e-02, -1.6855e+00, -1.0403e+00, -2.2902e+00,  4.7780e-01,\n",
      "         2.5868e+00, -1.4997e-02, -1.9199e-01, -1.9980e-02, -1.8147e-02,\n",
      "        -1.0964e+00, -1.4804e-03, -1.4536e-01, -9.3008e-03, -6.0837e-02,\n",
      "        -1.6855e+00, -4.9676e-02, -1.4706e-01,  2.3616e+00, -2.3058e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.17634916/0.9400000\n",
      "grad_weights: tensor([-5.1646e-02, -1.6565e+00, -1.0265e+00, -2.2601e+00,  4.7310e-01,\n",
      "         2.5664e+00, -1.4802e-02, -1.8909e-01, -1.9738e-02, -1.7934e-02,\n",
      "        -1.0816e+00, -1.4609e-03, -1.4351e-01, -9.1910e-03, -5.9902e-02,\n",
      "        -1.6662e+00, -4.9045e-02, -1.4404e-01,  2.3495e+00, -2.2742e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.17625979/0.9400000\n",
      "grad_weights: tensor([-5.1004e-02, -1.6279e+00, -1.0127e+00, -2.2302e+00,  4.6839e-01,\n",
      "         2.5459e+00, -1.4608e-02, -1.8623e-01, -1.9496e-02, -1.7722e-02,\n",
      "        -1.0669e+00, -1.4415e-03, -1.4166e-01, -9.0818e-03, -5.8976e-02,\n",
      "        -1.6468e+00, -4.8418e-02, -1.4108e-01,  2.3373e+00, -2.2428e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.17617142/0.9400000\n",
      "grad_weights: tensor([-5.0367e-02, -1.5997e+00, -9.9909e-01, -2.2005e+00,  4.6367e-01,\n",
      "         2.5253e+00, -1.4414e-02, -1.8339e-01, -1.9255e-02, -1.7511e-02,\n",
      "        -1.0522e+00, -1.4222e-03, -1.3984e-01, -8.9728e-03, -5.8060e-02,\n",
      "        -1.6276e+00, -4.7796e-02, -1.3817e-01,  2.3249e+00, -2.2116e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.17608403/0.9400000\n",
      "grad_weights: tensor([-4.9744e-02, -1.5719e+00, -9.8556e-01, -2.1712e+00,  4.5893e-01,\n",
      "         2.5046e+00, -1.4222e-02, -1.8058e-01, -1.9015e-02, -1.7303e-02,\n",
      "        -1.0376e+00, -1.4030e-03, -1.3802e-01, -8.8648e-03, -5.7150e-02,\n",
      "        -1.6088e+00, -4.7178e-02, -1.3531e-01,  2.3124e+00, -2.1809e-01],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 720 | 993 ####, loss/acc = 0.17599773/0.9400000\n",
      "grad_weights: tensor([-4.9113e-02, -1.5445e+00, -9.7219e-01, -2.1419e+00,  4.5422e-01,\n",
      "         2.4840e+00, -1.4031e-02, -1.7783e-01, -1.8778e-02, -1.7095e-02,\n",
      "        -1.0231e+00, -1.3843e-03, -1.3622e-01, -8.7573e-03, -5.6257e-02,\n",
      "        -1.5897e+00, -4.6568e-02, -1.3251e-01,  2.2998e+00, -2.1501e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 720 | 993 ####, loss/acc = 0.17591242/0.9400000\n",
      "grad_weights: tensor([-4.8486e-02, -1.5164e+00, -9.5811e-01, -2.1113e+00,  4.4896e-01,\n",
      "         2.4618e+00, -1.3842e-02, -1.7509e-01, -1.8531e-02, -1.6886e-02,\n",
      "        -1.0073e+00, -1.3648e-03, -1.3436e-01, -8.6437e-03, -5.5320e-02,\n",
      "        -1.5694e+00, -4.5923e-02, -1.2975e-01,  2.2870e+00, -2.1175e-01],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.6998, device='cuda:1'), 0.8, 0.8823529411764706)\n",
      "=====> Optimized weights: tensor([ 0.6366,  0.6355,  0.6364,  0.6364, -0.6372, -0.6376,  0.6364,  0.6360,\n",
      "         0.6366,  0.6367,  0.6364,  0.6360,  0.6365,  0.6367,  0.6359,  0.6368,\n",
      "         0.6365,  0.6347, -0.6383,  0.6363], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-2.5446, -0.1450, -0.0416, -0.1118, -0.1608, -1.4480, -0.7633, -0.0111,\n",
      "        -0.2633, -0.3348, -0.1589, -0.4386, -0.0126, -0.0286, -0.6517, -0.0637,\n",
      "        -0.2895, -0.3383, -2.8429, -0.0031], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.17665017/0.9400000\n",
      "grad_weights: tensor([-2.5219, -0.1421, -0.0411, -0.1106, -0.1591, -1.4351, -0.7559, -0.0110,\n",
      "        -0.2612, -0.3315, -0.1576, -0.4327, -0.0124, -0.0283, -0.6463, -0.0631,\n",
      "        -0.2862, -0.3352, -2.8161, -0.0030], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.17658471/0.9400000\n",
      "grad_weights: tensor([-2.4993, -0.1392, -0.0407, -0.1093, -0.1575, -1.4222, -0.7485, -0.0108,\n",
      "        -0.2592, -0.3282, -0.1564, -0.4269, -0.0123, -0.0280, -0.6409, -0.0626,\n",
      "        -0.2828, -0.3321, -2.7892, -0.0030], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.17651969/0.9400000\n",
      "grad_weights: tensor([-2.4768, -0.1364, -0.0402, -0.1080, -0.1558, -1.4093, -0.7412, -0.0107,\n",
      "        -0.2572, -0.3250, -0.1551, -0.4212, -0.0122, -0.0278, -0.6355, -0.0620,\n",
      "        -0.2795, -0.3289, -2.7625, -0.0030], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.17645521/0.9400000\n",
      "grad_weights: tensor([-2.4543, -0.1336, -0.0398, -0.1068, -0.1542, -1.3965, -0.7339, -0.0106,\n",
      "        -0.2551, -0.3218, -0.1538, -0.4155, -0.0121, -0.0275, -0.6302, -0.0614,\n",
      "        -0.2762, -0.3258, -2.7358, -0.0030], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.17639130/0.9400000\n",
      "grad_weights: tensor([-2.4319, -0.1309, -0.0393, -0.1056, -0.1526, -1.3837, -0.7266, -0.0105,\n",
      "        -0.2531, -0.3186, -0.1526, -0.4098, -0.0120, -0.0272, -0.6248, -0.0608,\n",
      "        -0.2728, -0.3227, -2.7092, -0.0029], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.17632791/0.9400000\n",
      "grad_weights: tensor([-2.4097, -0.1283, -0.0389, -0.1044, -0.1510, -1.3709, -0.7194, -0.0104,\n",
      "        -0.2529, -0.3154, -0.1513, -0.4043, -0.0118, -0.0269, -0.6195, -0.0603,\n",
      "        -0.2695, -0.3196, -2.6827, -0.0029], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.17626511/0.9400000\n",
      "grad_weights: tensor([-2.3868, -0.1256, -0.0384, -0.1031, -0.1493, -1.3579, -0.7120, -0.0103,\n",
      "        -0.2508, -0.3121, -0.1500, -0.3988, -0.0117, -0.0266, -0.6142, -0.0597,\n",
      "        -0.2661, -0.3164, -2.6557, -0.0029], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.17620283/0.9400000\n",
      "grad_weights: tensor([-2.3648, -0.1231, -0.0380, -0.1019, -0.1477, -1.3454, -0.7049, -0.0101,\n",
      "        -0.2488, -0.3090, -0.1488, -0.3933, -0.0116, -0.0263, -0.6090, -0.0591,\n",
      "        -0.2628, -0.3133, -2.6296, -0.0028], device='cuda:1')\n",
      "####Few Shot 740 | 993 ####, loss/acc = 0.17614114/0.9400000\n",
      "grad_weights: tensor([-2.3428, -0.1206, -0.0376, -0.1007, -0.1461, -1.3329, -0.6978, -0.0100,\n",
      "        -0.2468, -0.3059, -0.1475, -0.3879, -0.0115, -0.0261, -0.6037, -0.0586,\n",
      "        -0.2595, -0.3103, -2.6036, -0.0028], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.5000, device='cuda:1'), 0.8, 0.75)\n",
      "=====> Optimized weights: tensor([0.6201, 0.6175, 0.6196, 0.6195, 0.6197, 0.6201, 0.6199, 0.6196, 0.6205,\n",
      "        0.6199, 0.6203, 0.6191, 0.6199, 0.6198, 0.6202, 0.6200, 0.6194, 0.6200,\n",
      "        0.6199, 0.6199], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.7, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-5.7058e-01, -2.4348e-01, -2.8114e-01, -1.4277e+00, -3.1718e+00,\n",
      "        -5.8288e-01, -3.5355e-02, -1.1928e-01, -5.5727e-01, -2.6928e-01,\n",
      "        -3.7231e-02, -5.4358e-03, -1.5244e+00,  8.6688e-02, -3.2434e-03,\n",
      "        -4.9629e+00, -1.9389e+00, -2.8955e-01, -1.5979e-02, -3.2072e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.17665790/0.9400000\n",
      "grad_weights: tensor([-5.6612e-01, -2.4160e-01, -2.7910e-01, -1.4121e+00, -3.1482e+00,\n",
      "        -5.7847e-01, -3.4985e-02, -1.1822e-01, -5.5364e-01, -2.6705e-01,\n",
      "        -3.6926e-02, -5.3850e-03, -1.5135e+00,  8.6206e-02, -3.2167e-03,\n",
      "        -4.9278e+00, -1.9216e+00, -2.8698e-01, -1.5833e-02, -3.1738e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.17659993/0.9400000\n",
      "grad_weights: tensor([-5.6169e-01, -2.3974e-01, -2.7706e-01, -1.3966e+00, -3.1248e+00,\n",
      "        -5.7410e-01, -3.4617e-02, -1.1717e-01, -5.5002e-01, -2.6485e-01,\n",
      "        -3.6624e-02, -5.3350e-03, -1.5028e+00,  8.5723e-02, -3.1901e-03,\n",
      "        -4.8930e+00, -1.9045e+00, -2.8443e-01, -1.5688e-02, -3.1407e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.17654237/0.9400000\n",
      "grad_weights: tensor([-5.5726e-01, -2.3787e-01, -2.7502e-01, -1.3812e+00, -3.1015e+00,\n",
      "        -5.6972e-01, -3.4253e-02, -1.1612e-01, -5.4641e-01, -2.6264e-01,\n",
      "        -3.6322e-02, -5.2851e-03, -1.4920e+00,  8.5237e-02, -3.1634e-03,\n",
      "        -4.8581e+00, -1.8874e+00, -2.8186e-01, -1.5544e-02, -3.1077e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.17648518/0.9400000\n",
      "grad_weights: tensor([-5.5285e-01, -2.3599e-01, -2.7304e-01, -1.3659e+00, -3.0781e+00,\n",
      "        -5.6536e-01, -3.3890e-02, -1.1508e-01, -5.4280e-01, -2.6044e-01,\n",
      "        -3.6020e-02, -5.2353e-03, -1.4812e+00,  8.4749e-02, -3.1370e-03,\n",
      "        -4.8232e+00, -1.8704e+00, -2.7929e-01, -1.5400e-02, -3.0751e-01],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 760 | 993 ####, loss/acc = 0.17642838/0.9400000\n",
      "grad_weights: tensor([-5.4845e-01, -2.3413e-01, -2.7101e-01, -1.3508e+00, -3.0549e+00,\n",
      "        -5.6102e-01, -3.3531e-02, -1.1404e-01, -5.3920e-01, -2.5825e-01,\n",
      "        -3.5720e-02, -5.1858e-03, -1.4705e+00,  8.4261e-02, -3.1105e-03,\n",
      "        -4.7886e+00, -1.8535e+00, -2.7673e-01, -1.5258e-02, -3.0427e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.17637193/0.9400000\n",
      "grad_weights: tensor([-5.4409e-01, -2.3228e-01, -2.6900e-01, -1.3358e+00, -3.0317e+00,\n",
      "        -5.5672e-01, -3.3176e-02, -1.1301e-01, -5.3562e-01, -2.5606e-01,\n",
      "        -3.5423e-02, -5.1367e-03, -1.4599e+00,  8.3778e-02, -3.0846e-03,\n",
      "        -4.7542e+00, -1.8367e+00, -2.7419e-01, -1.5117e-02, -3.0107e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.17631593/0.9400000\n",
      "grad_weights: tensor([-5.3976e-01, -2.3044e-01, -2.6701e-01, -1.3211e+00, -3.0089e+00,\n",
      "        -5.5242e-01, -3.2825e-02, -1.1201e-01, -5.3206e-01, -2.5390e-01,\n",
      "        -3.5127e-02, -5.0883e-03, -1.4493e+00,  8.3309e-02, -3.0585e-03,\n",
      "        -4.7201e+00, -1.8200e+00, -2.7172e-01, -1.4976e-02, -2.9790e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.17626032/0.9400000\n",
      "grad_weights: tensor([-5.3527e-01, -2.2852e-01, -2.6500e-01, -1.3060e+00, -2.9851e+00,\n",
      "        -5.4798e-01, -3.2467e-02, -1.1096e-01, -5.2848e-01, -2.5168e-01,\n",
      "        -3.4822e-02, -5.0382e-03, -1.4384e+00,  8.2814e-02, -3.0315e-03,\n",
      "        -4.6844e+00, -1.8029e+00, -2.6920e-01, -1.4832e-02, -2.9468e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 760 | 993 ####, loss/acc = 0.17620516/0.9400000\n",
      "grad_weights: tensor([-5.3095e-01, -2.2666e-01, -2.6300e-01, -1.2914e+00, -2.9621e+00,\n",
      "        -5.4370e-01, -3.2119e-02, -1.0995e-01, -5.2489e-01, -2.4952e-01,\n",
      "        -3.4528e-02, -4.9900e-03, -1.4277e+00,  8.2318e-02, -3.0046e-03,\n",
      "        -4.6501e+00, -1.7864e+00, -2.6665e-01, -1.4694e-02, -2.9154e-01],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.7000, device='cuda:1'), 0.8, 0.8421052631578947)\n",
      "=====> Optimized weights: tensor([ 0.3547,  0.3548,  0.3548,  0.3543,  0.3548,  0.3548,  0.3544,  0.3546,\n",
      "         0.3549,  0.3547,  0.3547,  0.3545,  0.3548, -0.3550,  0.3546,  0.3548,\n",
      "         0.3546,  0.3546,  0.3546,  0.3544], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597]\n",
      "=====> init acc: (tensor(0.9000, device='cuda:1'), 0.9, 0.95)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.5111, -0.0415, -0.2040, -1.0376, -0.0449, -1.6389, -2.2773, -0.7075,\n",
      "        -0.0618, -3.3945, -0.0905, -0.0857, -0.9724, -0.0219, -0.7770, -0.8568,\n",
      "        -0.3469, -0.0120, -0.8574, -0.4361], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.17668329/0.9400000\n",
      "grad_weights: tensor([-0.5084, -0.0413, -0.2030, -1.0331, -0.0446, -1.6316, -2.2680, -0.7036,\n",
      "        -0.0615, -3.3796, -0.0900, -0.0854, -0.9681, -0.0218, -0.7727, -0.8525,\n",
      "        -0.3455, -0.0119, -0.8539, -0.4338], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.17665051/0.9400000\n",
      "grad_weights: tensor([-0.5056, -0.0411, -0.2020, -1.0286, -0.0444, -1.6244, -2.2588, -0.6997,\n",
      "        -0.0612, -3.3648, -0.0895, -0.0850, -0.9639, -0.0217, -0.7684, -0.8482,\n",
      "        -0.3440, -0.0119, -0.8505, -0.4316], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.17661783/0.9400000\n",
      "grad_weights: tensor([-0.5029, -0.0409, -0.2010, -1.0241, -0.0441, -1.6172, -2.2496, -0.6959,\n",
      "        -0.0610, -3.3500, -0.0890, -0.0847, -0.9597, -0.0215, -0.7641, -0.8439,\n",
      "        -0.3426, -0.0118, -0.8470, -0.4294], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.17658526/0.9400000\n",
      "grad_weights: tensor([-0.5001, -0.0407, -0.2001, -1.0197, -0.0439, -1.6100, -2.2404, -0.6920,\n",
      "        -0.0607, -3.3352, -0.0886, -0.0844, -0.9555, -0.0214, -0.7599, -0.8397,\n",
      "        -0.3411, -0.0118, -0.8435, -0.4272], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.17655279/0.9400000\n",
      "grad_weights: tensor([-0.4974, -0.0405, -0.1991, -1.0152, -0.0436, -1.6028, -2.2312, -0.6882,\n",
      "        -0.0604, -3.3204, -0.0881, -0.0840, -0.9513, -0.0213, -0.7556, -0.8354,\n",
      "        -0.3397, -0.0117, -0.8400, -0.4250], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.17652050/0.9400000\n",
      "grad_weights: tensor([-0.4947, -0.0404, -0.1981, -1.0107, -0.0434, -1.5957, -2.2220, -0.6844,\n",
      "        -0.0601, -3.3057, -0.0876, -0.0837, -0.9471, -0.0211, -0.7514, -0.8312,\n",
      "        -0.3383, -0.0117, -0.8366, -0.4228], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.17648831/0.9400000\n",
      "grad_weights: tensor([-0.4920, -0.0405, -0.1972, -1.0063, -0.0431, -1.5886, -2.2129, -0.6806,\n",
      "        -0.0598, -3.2911, -0.0871, -0.0834, -0.9429, -0.0210, -0.7472, -0.8270,\n",
      "        -0.3368, -0.0116, -0.8331, -0.4205], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.17645624/0.9400000\n",
      "grad_weights: tensor([-0.4893, -0.0403, -0.1962, -1.0018, -0.0429, -1.5814, -2.2038, -0.6768,\n",
      "        -0.0595, -3.2765, -0.0867, -0.0830, -0.9387, -0.0209, -0.7430, -0.8228,\n",
      "        -0.3354, -0.0116, -0.8297, -0.4183], device='cuda:1')\n",
      "####Few Shot 780 | 993 ####, loss/acc = 0.17642431/0.9400000\n",
      "grad_weights: tensor([-0.4866, -0.0401, -0.1952, -0.9974, -0.0426, -1.5743, -2.1947, -0.6730,\n",
      "        -0.0592, -3.2618, -0.0862, -0.0827, -0.9345, -0.0208, -0.7389, -0.8186,\n",
      "        -0.3340, -0.0115, -0.8262, -0.4161], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.9000, device='cuda:1'), 0.9, 0.95)\n",
      "=====> Optimized weights: tensor([0.2289, 0.2290, 0.2290, 0.2290, 0.2289, 0.2290, 0.2290, 0.2289, 0.2290,\n",
      "        0.2290, 0.2289, 0.2290, 0.2290, 0.2288, 0.2289, 0.2289, 0.2290, 0.2290,\n",
      "        0.2290, 0.2289], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597, 377, 78, 823, 1027]\n",
      "reset tmp model\n",
      "=====> init acc: (tensor(0.1000, device='cuda:1'), 0.6, 0.55)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([ 0.0965, -0.6335, -0.7159, -0.2426, -2.8392, -0.1126, -3.4093, -1.5161,\n",
      "        -4.4966, -0.5878, -0.0917,  1.2639, -0.1524, -0.2033, -1.3777, -0.0072,\n",
      "        -1.0217, -0.0947, -0.2329, -1.8215], device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.17668068/0.9400000\n",
      "grad_weights: tensor([ 0.0961, -0.6302, -0.7127, -0.2413, -2.8266, -0.1121, -3.3929, -1.5070,\n",
      "        -4.4720, -0.5848, -0.0912,  1.2643, -0.1517, -0.2022, -1.3710, -0.0072,\n",
      "        -1.0173, -0.0943, -0.2317, -1.8133], device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.17664529/0.9400000\n",
      "grad_weights: tensor([ 0.0957, -0.6269, -0.7095, -0.2400, -2.8141, -0.1116, -3.3765, -1.4980,\n",
      "        -4.4475, -0.5817, -0.0908,  1.2647, -0.1510, -0.2011, -1.3644, -0.0072,\n",
      "        -1.0130, -0.0938, -0.2304, -1.8051], device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 800 | 993 ####, loss/acc = 0.17661004/0.9400000\n",
      "grad_weights: tensor([ 0.0953, -0.6236, -0.7063, -0.2388, -2.8016, -0.1111, -3.3601, -1.4890,\n",
      "        -4.4230, -0.5787, -0.0903,  1.2651, -0.1502, -0.1999, -1.3577, -0.0071,\n",
      "        -1.0086, -0.0933, -0.2292, -1.7970], device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.17657492/0.9400000\n",
      "grad_weights: tensor([ 0.0949, -0.6203, -0.7031, -0.2375, -2.7891, -0.1106, -3.3438, -1.4800,\n",
      "        -4.3986, -0.5756, -0.0898,  1.2655, -0.1495, -0.1988, -1.3511, -0.0071,\n",
      "        -1.0043, -0.0929, -0.2279, -1.7888], device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.17653994/0.9400000\n",
      "grad_weights: tensor([ 0.0945, -0.6170, -0.7000, -0.2363, -2.7766, -0.1100, -3.3275, -1.4711,\n",
      "        -4.3743, -0.5726, -0.0894,  1.2659, -0.1488, -0.1977, -1.3445, -0.0070,\n",
      "        -1.0000, -0.0924, -0.2267, -1.7806], device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.17650510/0.9400000\n",
      "grad_weights: tensor([ 0.0941, -0.6138, -0.6968, -0.2350, -2.7642, -0.1095, -3.3113, -1.4622,\n",
      "        -4.3502, -0.5696, -0.0889,  1.2662, -0.1481, -0.1966, -1.3380, -0.0070,\n",
      "        -0.9957, -0.0920, -0.2255, -1.7726], device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.17647037/0.9400000\n",
      "grad_weights: tensor([ 0.0937, -0.6105, -0.6937, -0.2338, -2.7518, -0.1090, -3.2951, -1.4534,\n",
      "        -4.3261, -0.5666, -0.0884,  1.2666, -0.1473, -0.1955, -1.3315, -0.0070,\n",
      "        -0.9914, -0.0915, -0.2242, -1.7645], device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.17643583/0.9400000\n",
      "grad_weights: tensor([ 0.0933, -0.6073, -0.6905, -0.2325, -2.7393, -0.1085, -3.2790, -1.4445,\n",
      "        -4.3020, -0.5636, -0.0879,  1.2669, -0.1466, -0.1944, -1.3249, -0.0069,\n",
      "        -0.9870, -0.0910, -0.2230, -1.7564], device='cuda:1')\n",
      "####Few Shot 800 | 993 ####, loss/acc = 0.17640142/0.9400000\n",
      "grad_weights: tensor([ 0.0929, -0.6041, -0.6874, -0.2313, -2.7270, -0.1080, -3.2628, -1.4358,\n",
      "        -4.2780, -0.5606, -0.0875,  1.2672, -0.1459, -0.1933, -1.3184, -0.0069,\n",
      "        -0.9827, -0.0906, -0.2217, -1.7483], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.0999, device='cuda:1'), 0.4, 0.5555555555555556)\n",
      "=====> Optimized weights: tensor([-0.1699,  0.1698,  0.1699,  0.1698,  0.1699,  0.1699,  0.1698,  0.1698,\n",
      "         0.1698,  0.1698,  0.1698, -0.1701,  0.1698,  0.1698,  0.1698,  0.1698,\n",
      "         0.1699,  0.1698,  0.1698,  0.1699], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597, 377, 78, 823, 1027, 567, 604, 801, 171]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.7, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-1.4907, -9.5977, -0.4352,  0.2303, -2.4592, -0.0781, -0.0210,  1.1206,\n",
      "        -0.0799, -7.4906, -0.4046, -0.0188,  0.3521, -0.1632, -1.5258, -0.1509,\n",
      "        -0.0638, -1.1630, -0.4591, -0.2042], device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.17663838/0.9400000\n",
      "grad_weights: tensor([-1.4772, -9.4899, -0.4294,  0.2272, -2.4340, -0.0773, -0.0209,  1.1144,\n",
      "        -0.0790, -7.4159, -0.4000, -0.0186,  0.3488, -0.1615, -1.5092, -0.1489,\n",
      "        -0.0632, -1.1456, -0.4545, -0.2018], device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.17656118/0.9400000\n",
      "grad_weights: tensor([-1.4637, -9.3825, -0.4236,  0.2242, -2.4089, -0.0766, -0.0207,  1.1082,\n",
      "        -0.0780, -7.3413, -0.3954, -0.0184,  0.3454, -0.1598, -1.4927, -0.1469,\n",
      "        -0.0625, -1.1285, -0.4498, -0.1995], device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.17648463/0.9400000\n",
      "grad_weights: tensor([-1.4504, -9.2760, -0.4179,  0.2211, -2.3840, -0.0758, -0.0205,  1.1019,\n",
      "        -0.0771, -7.2670, -0.3909, -0.0182,  0.3421, -0.1582, -1.4764, -0.1449,\n",
      "        -0.0619, -1.1116, -0.4452, -0.1972], device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.17640875/0.9400000\n",
      "grad_weights: tensor([-1.4370, -9.1698, -0.4123,  0.2180, -2.3592, -0.0751, -0.0203,  1.0956,\n",
      "        -0.0762, -7.1929, -0.3864, -0.0181,  0.3388, -0.1565, -1.4602, -0.1429,\n",
      "        -0.0612, -1.0948, -0.4405, -0.1950], device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.17633352/0.9400000\n",
      "grad_weights: tensor([-1.4237, -9.0640, -0.4067,  0.2149, -2.3345, -0.0743, -0.0201,  1.0892,\n",
      "        -0.0753, -7.1191, -0.3819, -0.0179,  0.3355, -0.1548, -1.4440, -0.1410,\n",
      "        -0.0606, -1.0782, -0.4359, -0.1927], device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.17625897/0.9400000\n",
      "grad_weights: tensor([-1.4104, -8.9588, -0.4012,  0.2119, -2.3101, -0.0736, -0.0199,  1.0829,\n",
      "        -0.0744, -7.0457, -0.3774, -0.0177,  0.3321, -0.1532, -1.4279, -0.1390,\n",
      "        -0.0599, -1.0619, -0.4313, -0.1905], device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.17618513/0.9400000\n",
      "grad_weights: tensor([-1.3972, -8.8548, -0.3957,  0.2088, -2.2858, -0.0729, -0.0197,  1.0766,\n",
      "        -0.0735, -6.9727, -0.3730, -0.0175,  0.3288, -0.1515, -1.4121, -0.1371,\n",
      "        -0.0593, -1.0457, -0.4268, -0.1883], device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.17611203/0.9400000\n",
      "grad_weights: tensor([-1.3835, -8.7483, -0.3902,  0.2058, -2.2611, -0.0721, -0.0195,  1.0699,\n",
      "        -0.0726, -6.8998, -0.3685, -0.0173,  0.3255, -0.1499, -1.3959, -0.1352,\n",
      "        -0.0587, -1.0294, -0.4221, -0.1860], device='cuda:1')\n",
      "####Few Shot 820 | 993 ####, loss/acc = 0.17603968/0.9400000\n",
      "grad_weights: tensor([-1.3704, -8.6449, -0.3848,  0.2027, -2.2370, -0.0714, -0.0193,  1.0635,\n",
      "        -0.0717, -6.8273, -0.3641, -0.0172,  0.3221, -0.1482, -1.3801, -0.1334,\n",
      "        -0.0580, -1.0137, -0.4176, -0.1838], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.4002, device='cuda:1'), 0.8, 0.7647058823529411)\n",
      "=====> Optimized weights: tensor([ 0.2832,  0.2829,  0.2827, -0.2827,  0.2830,  0.2831,  0.2831, -0.2835,\n",
      "         0.2829,  0.2831,  0.2829,  0.2831, -0.2831,  0.2830,  0.2830,  0.2827,\n",
      "         0.2830,  0.2826,  0.2830,  0.2829], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597, 377, 78, 823, 1027, 567, 604, 801, 171, 334, 20, 756, 380]\n",
      "=====> init acc: (tensor(0.7000, device='cuda:1'), 0.9, 0.85)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-1.2288e-01, -1.1495e-01, -3.1979e-02,  5.9556e+00, -1.0923e-02,\n",
      "        -8.3508e-01, -1.0999e-01, -4.9254e-01, -4.8057e-01, -3.2479e-03,\n",
      "        -3.7799e-02, -6.2347e-01,  1.3723e+00, -9.2651e-03, -2.7882e-01,\n",
      "        -1.5265e-01, -6.1156e-02, -1.2996e-02, -8.6478e-02, -3.5313e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.17661972/0.9400000\n",
      "grad_weights: tensor([-1.2137e-01, -1.1359e-01, -3.1504e-02,  5.9210e+00, -1.0786e-02,\n",
      "        -8.2462e-01, -1.0852e-01, -4.8387e-01, -4.7275e-01, -3.1998e-03,\n",
      "        -3.7292e-02, -6.1582e-01,  1.3586e+00, -9.1392e-03, -2.7453e-01,\n",
      "        -1.5028e-01, -6.0456e-02, -1.2817e-02, -8.3549e-02, -3.4873e-01],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 840 | 993 ####, loss/acc = 0.17652430/0.9400000\n",
      "grad_weights: tensor([-1.1986e-01, -1.1223e-01, -3.1028e-02,  5.8857e+00, -1.0650e-02,\n",
      "        -8.1734e-01, -1.0705e-01, -4.7529e-01, -4.6501e-01, -3.1520e-03,\n",
      "        -3.6785e-02, -6.0815e-01,  1.3447e+00, -9.0138e-03, -2.7024e-01,\n",
      "        -1.4791e-01, -5.9756e-02, -1.2565e-02, -8.2131e-02, -3.4435e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.17642984/0.9400000\n",
      "grad_weights: tensor([-1.1837e-01, -1.1088e-01, -3.0557e-02,  5.8505e+00, -1.0515e-02,\n",
      "        -8.0695e-01, -1.0560e-01, -4.6683e-01, -4.5738e-01, -3.1050e-03,\n",
      "        -3.6285e-02, -6.0055e-01,  1.3311e+00, -8.8899e-03, -2.6600e-01,\n",
      "        -1.4558e-01, -5.9060e-02, -1.2390e-02, -8.0733e-02, -3.4000e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.17633647/0.9400000\n",
      "grad_weights: tensor([-1.1690e-01, -1.0953e-01, -3.0087e-02,  5.8150e+00, -1.0381e-02,\n",
      "        -7.9660e-01, -1.0415e-01, -4.5848e-01, -4.4985e-01, -3.0580e-03,\n",
      "        -3.5789e-02, -5.9309e-01,  1.3173e+00, -8.7662e-03, -2.6176e-01,\n",
      "        -1.4324e-01, -5.8368e-02, -1.2216e-02, -7.9353e-02, -3.3569e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.17624412/0.9400000\n",
      "grad_weights: tensor([-1.1540e-01, -1.0815e-01, -2.9606e-02,  5.7772e+00, -1.0245e-02,\n",
      "        -7.8604e-01, -1.0269e-01, -4.5010e-01, -4.4225e-01, -3.0107e-03,\n",
      "        -3.5289e-02, -5.8534e-01,  1.3032e+00, -8.6408e-03, -2.5752e-01,\n",
      "        -1.4087e-01, -5.7660e-02, -1.2039e-02, -7.7987e-02, -3.3129e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.17615291/0.9400000\n",
      "grad_weights: tensor([-1.1391e-01, -1.0681e-01, -2.9149e-02,  5.7406e+00, -1.0111e-02,\n",
      "        -7.7574e-01, -1.0125e-01, -4.4192e-01, -4.3485e-01, -2.9644e-03,\n",
      "        -3.4799e-02, -5.7787e-01,  1.2892e+00, -8.5182e-03, -2.5328e-01,\n",
      "        -1.3858e-01, -5.6970e-02, -1.1867e-02, -7.6638e-02, -3.2700e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.17606272/0.9400000\n",
      "grad_weights: tensor([-1.1243e-01, -1.0547e-01, -2.8681e-02,  5.7034e+00, -9.9792e-03,\n",
      "        -7.6548e-01, -9.9828e-02, -4.3386e-01, -4.2755e-01, -2.9186e-03,\n",
      "        -3.4314e-02, -5.7036e-01,  1.2754e+00, -8.3968e-03, -2.4909e-01,\n",
      "        -1.3628e-01, -5.6280e-02, -1.1697e-02, -7.5306e-02, -3.2273e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.17597367/0.9400000\n",
      "grad_weights: tensor([-1.1095e-01, -1.0414e-01, -2.8214e-02,  5.6658e+00, -9.8477e-03,\n",
      "        -7.5531e-01, -9.8410e-02, -4.2590e-01, -4.2035e-01, -2.8732e-03,\n",
      "        -3.3832e-02, -5.6288e-01,  1.2615e+00, -8.2760e-03, -2.4490e-01,\n",
      "        -1.3399e-01, -5.5594e-02, -1.1528e-02, -7.3991e-02, -3.1849e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 840 | 993 ####, loss/acc = 0.17588572/0.9400000\n",
      "grad_weights: tensor([-1.0948e-01, -1.0283e-01, -2.7751e-02,  5.6278e+00, -9.7168e-03,\n",
      "        -7.4518e-01, -9.7000e-02, -4.1803e-01, -4.1324e-01, -2.8281e-03,\n",
      "        -3.3355e-02, -5.5544e-01,  1.2476e+00, -8.1559e-03, -2.4074e-01,\n",
      "        -1.3172e-01, -5.4912e-02, -1.1359e-02, -7.2692e-02, -3.1427e-01],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.4994, device='cuda:1'), 0.7, 0.8333333333333334)\n",
      "=====> Optimized weights: tensor([ 0.8662,  0.8663,  0.8652, -0.8682,  0.8660,  0.8663,  0.8658,  0.8644,\n",
      "         0.8649,  0.8651,  0.8658,  0.8662, -0.8669,  0.8656,  0.8651,  0.8650,\n",
      "         0.8664,  0.8653,  0.8641,  0.8661], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597, 377, 78, 823, 1027, 567, 604, 801, 171, 334, 20, 756, 380, 595, 342, 399, 724]\n",
      "=====> init acc: (tensor(0.8000, device='cuda:1'), 0.8, 0.9)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-6.4102e-01, -4.6261e-01, -2.0750e-01, -4.7017e-02, -3.8063e+00,\n",
      "        -3.1067e-01, -2.8181e-01, -1.7414e-03, -1.1635e-02, -2.9499e-02,\n",
      "        -1.1935e+00, -1.4945e+00, -2.0366e-03, -1.0097e-02, -1.2000e-02,\n",
      "        -8.4978e-03, -3.4537e-01, -1.7149e-03,  2.5970e-01, -1.4381e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.17665197/0.9400000\n",
      "grad_weights: tensor([-6.3400e-01, -4.5822e-01, -2.0595e-01, -4.6637e-02, -3.7664e+00,\n",
      "        -3.0832e-01, -2.7911e-01, -1.7258e-03, -1.1537e-02, -2.9255e-02,\n",
      "        -1.1813e+00, -1.4812e+00, -2.0142e-03, -1.0003e-02, -1.1867e-02,\n",
      "        -8.4327e-03, -3.4228e-01, -1.6961e-03,  2.5839e-01, -1.4245e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.17658813/0.9400000\n",
      "grad_weights: tensor([-6.2703e-01, -4.5387e-01, -2.0441e-01, -4.6256e-02, -3.7267e+00,\n",
      "        -3.0598e-01, -2.7642e-01, -1.7102e-03, -1.1438e-02, -2.9012e-02,\n",
      "        -1.1692e+00, -1.4678e+00, -1.9927e-03, -9.9091e-03, -1.1734e-02,\n",
      "        -8.3676e-03, -3.3919e-01, -1.6774e-03,  2.5708e-01, -1.4110e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.17652479/0.9400000\n",
      "grad_weights: tensor([-6.2011e-01, -4.4952e-01, -2.0287e-01, -4.5875e-02, -3.6872e+00,\n",
      "        -3.0364e-01, -2.7372e-01, -1.6945e-03, -1.1339e-02, -2.8770e-02,\n",
      "        -1.1571e+00, -1.4546e+00, -1.9710e-03, -9.8159e-03, -1.1603e-02,\n",
      "        -8.3022e-03, -3.3611e-01, -1.6587e-03,  2.5575e-01, -1.3975e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.17646191/0.9400000\n",
      "grad_weights: tensor([-6.1327e-01, -4.4520e-01, -2.0134e-01, -4.5498e-02, -3.6482e+00,\n",
      "        -3.0132e-01, -2.7103e-01, -1.6790e-03, -1.1240e-02, -2.8530e-02,\n",
      "        -1.1451e+00, -1.4414e+00, -1.9493e-03, -9.7232e-03, -1.1472e-02,\n",
      "        -8.2373e-03, -3.3305e-01, -1.6406e-03,  2.5443e-01, -1.3841e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.17639951/0.9400000\n",
      "grad_weights: tensor([-6.0647e-01, -4.4088e-01, -1.9981e-01, -4.5121e-02, -3.6093e+00,\n",
      "        -2.9900e-01, -2.6835e-01, -1.6635e-03, -1.1141e-02, -2.8395e-02,\n",
      "        -1.1332e+00, -1.4283e+00, -1.9281e-03, -9.6311e-03, -1.1343e-02,\n",
      "        -8.1725e-03, -3.3000e-01, -1.6225e-03,  2.5309e-01, -1.3708e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.17633758/0.9400000\n",
      "grad_weights: tensor([-5.9974e-01, -4.3662e-01, -1.9829e-01, -4.4751e-02, -3.5709e+00,\n",
      "        -2.9669e-01, -2.6568e-01, -1.6481e-03, -1.1046e-02, -2.8155e-02,\n",
      "        -1.1214e+00, -1.4154e+00, -1.9071e-03, -9.5393e-03, -1.1215e-02,\n",
      "        -8.1086e-03, -3.2701e-01, -1.6042e-03,  2.5176e-01, -1.3576e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.17627616/0.9400000\n",
      "grad_weights: tensor([-5.9305e-01, -4.3234e-01, -1.9677e-01, -4.4376e-02, -3.5325e+00,\n",
      "        -2.9438e-01, -2.6301e-01, -1.6327e-03, -1.0947e-02, -2.7916e-02,\n",
      "        -1.1096e+00, -1.4024e+00, -1.8861e-03, -9.4481e-03, -1.1088e-02,\n",
      "        -8.0440e-03, -3.2399e-01, -1.5866e-03,  2.5040e-01, -1.3445e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.17621529/0.9400000\n",
      "grad_weights: tensor([-5.8643e-01, -4.2807e-01, -1.9526e-01, -4.4004e-02, -3.4945e+00,\n",
      "        -2.9209e-01, -2.6035e-01, -1.6080e-03, -1.0850e-02, -2.7679e-02,\n",
      "        -1.0979e+00, -1.3895e+00, -1.8653e-03, -9.3576e-03, -1.0962e-02,\n",
      "        -7.9797e-03, -3.2098e-01, -1.5686e-03,  2.4904e-01, -1.3314e-01],\n",
      "       device='cuda:1')\n",
      "####Few Shot 860 | 993 ####, loss/acc = 0.17615484/0.9400000\n",
      "grad_weights: tensor([-5.7987e-01, -4.2380e-01, -1.9375e-01, -4.3631e-02, -3.4567e+00,\n",
      "        -2.8979e-01, -2.5770e-01, -1.5925e-03, -1.0751e-02, -2.7442e-02,\n",
      "        -1.0863e+00, -1.3767e+00, -1.8442e-03, -9.2675e-03, -1.0837e-02,\n",
      "        -7.9148e-03, -3.1798e-01, -1.5510e-03,  2.4767e-01, -1.3184e-01],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> Optimized acc: (tensor(0.6998, device='cuda:1'), 0.9, 0.8947368421052632)\n",
      "=====> Optimized weights: tensor([ 0.6927,  0.6931,  0.6936,  0.6934,  0.6928,  0.6936,  0.6930,  0.6927,\n",
      "         0.6933,  0.6935,  0.6929,  0.6932,  0.6924,  0.6931,  0.6926,  0.6935,\n",
      "         0.6932,  0.6923, -0.6942,  0.6931], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597, 377, 78, 823, 1027, 567, 604, 801, 171, 334, 20, 756, 380, 595, 342, 399, 724, 317, 944, 811, 193]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.7, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.1548, -0.1587, -0.2020, -3.9377, -0.3312, -0.7418, -0.0965, -0.0103,\n",
      "        -0.0133, -0.2169, -1.0809, -3.0626, -0.5972, -4.1612, -2.3567, -0.4542,\n",
      "         1.2908, -0.0115, -0.0042, -0.0668], device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.17662925/0.9400000\n",
      "grad_weights: tensor([-0.1527, -0.1564, -0.1996, -3.8976, -0.3275, -0.7339, -0.0953, -0.0102,\n",
      "        -0.0131, -0.2146, -1.0692, -3.0289, -0.5905, -4.1165, -2.3303, -0.4476,\n",
      "         1.2846, -0.0113, -0.0042, -0.0661], device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.17654304/0.9400000\n",
      "grad_weights: tensor([-0.1505, -0.1541, -0.1972, -3.8574, -0.3238, -0.7259, -0.0941, -0.0101,\n",
      "        -0.0129, -0.2122, -1.0575, -2.9953, -0.5839, -4.0719, -2.3038, -0.4411,\n",
      "         1.2784, -0.0111, -0.0041, -0.0653], device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.17645769/0.9400000\n",
      "grad_weights: tensor([-0.1483, -0.1518, -0.1949, -3.8173, -0.3202, -0.7181, -0.0929, -0.0100,\n",
      "        -0.0128, -0.2098, -1.0459, -2.9619, -0.5773, -4.0276, -2.2775, -0.4346,\n",
      "         1.2722, -0.0109, -0.0041, -0.0646], device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.17637318/0.9400000\n",
      "grad_weights: tensor([-0.1462, -0.1496, -0.1926, -3.7777, -0.3165, -0.7103, -0.0917, -0.0099,\n",
      "        -0.0126, -0.2075, -1.0345, -2.9289, -0.5708, -3.9839, -2.2517, -0.4283,\n",
      "         1.2661, -0.0107, -0.0040, -0.0639], device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.17628948/0.9400000\n",
      "grad_weights: tensor([-0.1440, -0.1473, -0.1902, -3.7368, -0.3128, -0.7022, -0.0904, -0.0098,\n",
      "        -0.0124, -0.2052, -1.0226, -2.8950, -0.5641, -3.9388, -2.2248, -0.4218,\n",
      "         1.2597, -0.0105, -0.0040, -0.0631], device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.17620666/0.9400000\n",
      "grad_weights: tensor([-0.1419, -0.1451, -0.1879, -3.6970, -0.3091, -0.6944, -0.0892, -0.0097,\n",
      "        -0.0122, -0.2028, -1.0111, -2.8622, -0.5576, -3.8950, -2.1987, -0.4155,\n",
      "         1.2532, -0.0103, -0.0039, -0.0624], device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.17612472/0.9400000\n",
      "grad_weights: tensor([-0.1397, -0.1429, -0.1856, -3.6573, -0.3055, -0.6867, -0.0880, -0.0096,\n",
      "        -0.0120, -0.2005, -0.9995, -2.8295, -0.5512, -3.8515, -2.1727, -0.4093,\n",
      "         1.2467, -0.0101, -0.0039, -0.0617], device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.17604370/0.9400000\n",
      "grad_weights: tensor([-0.1376, -0.1408, -0.1834, -3.6178, -0.3019, -0.6790, -0.0868, -0.0094,\n",
      "        -0.0118, -0.1981, -0.9881, -2.7969, -0.5448, -3.8082, -2.1468, -0.4031,\n",
      "         1.2402, -0.0099, -0.0038, -0.0610], device='cuda:1')\n",
      "####Few Shot 880 | 993 ####, loss/acc = 0.17596355/0.9400000\n",
      "grad_weights: tensor([-0.1353, -0.1379, -0.1811, -3.5753, -0.2983, -0.6713, -0.0856, -0.0093,\n",
      "        -0.0117, -0.1958, -0.9767, -2.7646, -0.5384, -3.7652, -2.1210, -0.3970,\n",
      "         1.2336, -0.0097, -0.0038, -0.0603], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.2995, device='cuda:1'), 0.5, 0.6842105263157895)\n",
      "=====> Optimized weights: tensor([ 0.4587,  0.4586,  0.4591,  0.4594,  0.4592,  0.4593,  0.4589,  0.4593,\n",
      "         0.4586,  0.4592,  0.4593,  0.4592,  0.4592,  0.4593,  0.4592,  0.4586,\n",
      "        -0.4603,  0.4578,  0.4590,  0.4592], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597, 377, 78, 823, 1027, 567, 604, 801, 171, 334, 20, 756, 380, 595, 342, 399, 724, 317, 944, 811, 193, 359, 814, 100, 982]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.7, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-0.2537, -2.6544, -1.4117, -0.2312, -0.1257,  2.4054, -3.7826, -0.4603,\n",
      "        -0.0111, -0.2983, -0.0078, -1.8856, -4.6093, -0.6723, -0.2075, -0.0350,\n",
      "        -0.4418, -0.6692, -2.2015, -0.0047], device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.17666571/0.9400000\n",
      "grad_weights: tensor([-0.2520, -2.6369, -1.4021, -0.2297, -0.1249,  2.3971, -3.7525, -0.4565,\n",
      "        -0.0110, -0.2963, -0.0077, -1.8736, -4.5772, -0.6679, -0.2060, -0.0348,\n",
      "        -0.4386, -0.6645, -2.1860, -0.0047], device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.17661545/0.9400000\n",
      "grad_weights: tensor([-0.2504, -2.6196, -1.3925, -0.2283, -0.1240,  2.3887, -3.7226, -0.4528,\n",
      "        -0.0110, -0.2944, -0.0077, -1.8616, -4.5454, -0.6634, -0.2046, -0.0345,\n",
      "        -0.4354, -0.6597, -2.1705, -0.0046], device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.17656551/0.9400000\n",
      "grad_weights: tensor([-0.2487, -2.6022, -1.3829, -0.2268, -0.1232,  2.3803, -3.6928, -0.4491,\n",
      "        -0.0109, -0.2925, -0.0076, -1.8496, -4.5136, -0.6590, -0.2031, -0.0343,\n",
      "        -0.4322, -0.6550, -2.1550, -0.0046], device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.17651585/0.9400000\n",
      "grad_weights: tensor([-0.2471, -2.5849, -1.3734, -0.2254, -0.1224,  2.3719, -3.6632, -0.4454,\n",
      "        -0.0108, -0.2906, -0.0076, -1.8376, -4.4819, -0.6545, -0.2017, -0.0341,\n",
      "        -0.4290, -0.6504, -2.1396, -0.0045], device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.17646646/0.9400000\n",
      "grad_weights: tensor([-0.2454, -2.5677, -1.3639, -0.2240, -0.1216,  2.3635, -3.6338, -0.4416,\n",
      "        -0.0107, -0.2887, -0.0075, -1.8256, -4.4505, -0.6501, -0.2002, -0.0338,\n",
      "        -0.4258, -0.6457, -2.1243, -0.0045], device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.17641735/0.9400000\n",
      "grad_weights: tensor([-2.4376e-01, -2.5505e+00, -1.3544e+00, -2.2251e-01, -1.2080e-01,\n",
      "         2.3550e+00, -3.6045e+00, -4.3792e-01, -1.0646e-02, -2.8684e-01,\n",
      "        -7.4713e-03, -1.8135e+00, -4.4190e+00, -6.4573e-01, -1.9878e-01,\n",
      "        -3.3612e-02, -4.2264e-01, -6.4107e-01, -2.1090e+00, -4.4136e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.17636858/0.9400000\n",
      "grad_weights: tensor([-2.4211e-01, -2.5334e+00, -1.3449e+00, -2.2108e-01, -1.2000e-01,\n",
      "         2.3465e+00, -3.5753e+00, -4.3421e-01, -1.0569e-02, -2.8495e-01,\n",
      "        -7.4204e-03, -1.8015e+00, -4.3877e+00, -6.4134e-01, -1.9734e-01,\n",
      "        -3.3384e-02, -4.1949e-01, -6.3645e-01, -2.0937e+00, -4.3657e-03],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 900 | 993 ####, loss/acc = 0.17632006/0.9400000\n",
      "grad_weights: tensor([-2.4047e-01, -2.5163e+00, -1.3355e+00, -2.1964e-01, -1.1920e-01,\n",
      "         2.3380e+00, -3.5463e+00, -4.3048e-01, -1.0493e-02, -2.8306e-01,\n",
      "        -7.3697e-03, -1.7896e+00, -4.3565e+00, -6.3696e-01, -1.9590e-01,\n",
      "        -3.3156e-02, -4.1636e-01, -6.3184e-01, -2.0786e+00, -4.3177e-03],\n",
      "       device='cuda:1')\n",
      "####Few Shot 900 | 993 ####, loss/acc = 0.17627186/0.9400000\n",
      "grad_weights: tensor([-2.3883e-01, -2.4994e+00, -1.3261e+00, -2.1821e-01, -1.1840e-01,\n",
      "         2.3294e+00, -3.5174e+00, -4.2678e-01, -1.0417e-02, -2.8117e-01,\n",
      "        -7.3192e-03, -1.7777e+00, -4.3255e+00, -6.3260e-01, -1.9448e-01,\n",
      "        -3.2929e-02, -4.1325e-01, -6.2727e-01, -2.0635e+00, -4.2701e-03],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.2998, device='cuda:1'), 0.5, 0.6842105263157895)\n",
      "=====> Optimized weights: tensor([ 0.2258,  0.2258,  0.2258,  0.2259,  0.2258, -0.2261,  0.2257,  0.2257,\n",
      "         0.2258,  0.2259,  0.2258,  0.2259,  0.2258,  0.2258,  0.2258,  0.2258,\n",
      "         0.2258,  0.2258,  0.2258,  0.2255], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597, 377, 78, 823, 1027, 567, 604, 801, 171, 334, 20, 756, 380, 595, 342, 399, 724, 317, 944, 811, 193, 359, 814, 100, 982, 251, 862, 496, 364]\n",
      "=====> init acc: (tensor(0.4000, device='cuda:1'), 0.8, 0.7)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-2.8124e-01, -5.0043e-01,  9.5152e-02, -1.1110e-01, -1.0821e-01,\n",
      "        -1.0262e+00, -5.4627e-01, -1.4722e+00, -8.0236e-02,  8.3263e-03,\n",
      "        -7.1314e-02, -9.7752e-02, -1.4218e-02, -1.5893e+01, -9.1015e-02,\n",
      "        -3.0936e-01, -2.3522e+00, -9.2284e-02, -2.5935e-03, -1.6623e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.17648195/0.9400000\n",
      "grad_weights: tensor([-2.7241e-01, -4.8619e-01,  9.1240e-02, -1.0770e-01, -1.0402e-01,\n",
      "        -9.9496e-01, -5.3124e-01, -1.4229e+00, -7.7631e-02,  7.8713e-03,\n",
      "        -6.7117e-02, -9.4263e-02, -1.3656e-02, -1.5428e+01, -8.8462e-02,\n",
      "        -2.9974e-01, -2.2259e+00, -8.9057e-02, -2.5160e-03, -1.6148e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.17625345/0.9400000\n",
      "grad_weights: tensor([-2.6354e-01, -4.7200e-01,  8.7258e-02, -1.0433e-01, -9.9917e-02,\n",
      "        -9.6378e-01, -5.1632e-01, -1.3741e+00, -7.5039e-02,  7.4088e-03,\n",
      "        -6.2953e-02, -9.0763e-02, -1.3104e-02, -1.4963e+01, -8.5929e-02,\n",
      "        -2.9013e-01, -2.1047e+00, -8.5864e-02, -2.4419e-03, -1.5676e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.17603092/0.9400000\n",
      "grad_weights: tensor([-2.5480e-01, -4.5804e-01,  8.3341e-02, -1.0102e-01, -9.5954e-02,\n",
      "        -9.3271e-01, -5.0152e-01, -1.3266e+00, -7.2495e-02,  6.9508e-03,\n",
      "        -5.8840e-02, -8.7314e-02, -1.2572e-02, -1.4503e+01, -8.3444e-02,\n",
      "        -2.8075e-01, -1.9892e+00, -8.2712e-02, -2.3690e-03, -1.5212e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.17581457/0.9400000\n",
      "grad_weights: tensor([-2.4606e-01, -4.4392e-01,  7.9406e-02, -9.7687e-02, -9.2110e-02,\n",
      "        -9.0185e-01, -4.8644e-01, -1.2789e+00, -6.9987e-02,  6.4902e-03,\n",
      "        -5.4576e-02, -8.3818e-02, -1.2056e-02, -1.4037e+01, -8.0994e-02,\n",
      "        -2.7132e-01, -1.8777e+00, -7.9501e-02, -2.2967e-03, -1.4755e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.17560446/0.9500000\n",
      "grad_weights: tensor([-2.3706e-01, -4.3027e-01,  7.5476e-02, -9.4378e-02, -8.8290e-02,\n",
      "        -8.7138e-01, -4.7187e-01, -1.2331e+00, -6.7519e-02,  6.0175e-03,\n",
      "        -5.0428e-02, -8.0467e-02, -1.1555e-02, -1.3571e+01, -7.8516e-02,\n",
      "        -2.6223e-01, -1.7728e+00, -7.6419e-02, -2.2253e-03, -1.4308e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.17540069/0.9500000\n",
      "grad_weights: tensor([-2.2845e-01, -4.1687e-01,  7.1556e-02, -9.1231e-02, -8.4682e-02,\n",
      "        -8.4094e-01, -4.5749e-01, -1.1884e+00, -6.5083e-02,  5.5558e-03,\n",
      "        -4.6482e-02, -7.7119e-02, -1.1070e-02, -1.3124e+01, -7.6147e-02,\n",
      "        -2.5329e-01, -1.6730e+00, -7.3386e-02, -2.1547e-03, -1.3864e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.17520319/0.9500000\n",
      "grad_weights: tensor([-2.1987e-01, -4.0359e-01,  6.7644e-02, -8.8135e-02, -8.1184e-02,\n",
      "        -8.1072e-01, -4.4325e-01, -1.1446e+00, -6.2686e-02,  5.0931e-03,\n",
      "        -4.2593e-02, -7.3785e-02, -1.0601e-02, -1.2682e+01, -7.3817e-02,\n",
      "        -2.4453e-01, -1.5780e+00, -7.0395e-02, -2.0850e-03, -1.3426e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.17501223/0.9500000\n",
      "grad_weights: tensor([-2.1120e-01, -3.9059e-01,  6.3741e-02, -8.5053e-02, -7.7767e-02,\n",
      "        -7.8052e-01, -4.2919e-01, -1.1018e+00, -6.0326e-02,  4.6307e-03,\n",
      "        -3.8750e-02, -7.0506e-02, -1.0146e-02, -1.2241e+01, -7.1507e-02,\n",
      "        -2.3579e-01, -1.4871e+00, -6.7400e-02, -2.0152e-03, -1.2991e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 920 | 993 ####, loss/acc = 0.17482769/0.9500000\n",
      "grad_weights: tensor([-2.0274e-01, -3.7771e-01,  5.9845e-02, -8.2050e-02, -7.4478e-02,\n",
      "        -7.5070e-01, -4.1523e-01, -1.0596e+00, -5.7996e-02,  4.1686e-03,\n",
      "        -3.4982e-02, -6.7251e-02, -9.7043e-03, -1.1808e+01, -6.9248e-02,\n",
      "        -2.2727e-01, -1.4011e+00, -6.4471e-02, -1.9467e-03, -1.2565e-02],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.6001, device='cuda:1'), 0.8, 0.7777777777777778)\n",
      "=====> Optimized weights: tensor([ 1.0095,  1.0114, -1.0035,  1.0104,  1.0069,  1.0102,  1.0118,  1.0092,\n",
      "         1.0095, -0.9930,  0.9913,  1.0073,  1.0065,  1.0108,  1.0118,  1.0102,\n",
      "         0.9994,  1.0080,  1.0108,  1.0115], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597, 377, 78, 823, 1027, 567, 604, 801, 171, 334, 20, 756, 380, 595, 342, 399, 724, 317, 944, 811, 193, 359, 814, 100, 982, 251, 862, 496, 364, 449, 278, 117, 63]\n",
      "=====> init acc: (tensor(0.6000, device='cuda:1'), 0.6, 0.8)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-2.8979e-02, -1.6150e-01, -8.9162e-02,  6.2349e-01, -4.2574e-02,\n",
      "        -1.4215e+00, -1.2942e+00, -3.9237e+00, -7.1473e-02, -1.1685e-04,\n",
      "        -3.2404e-01, -1.8094e+00, -2.9740e-02, -5.4492e-02, -3.2601e-01,\n",
      "        -7.1923e-03, -6.1928e-02, -2.9241e-01, -1.4634e-01, -2.2993e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.17659672/0.9400000\n",
      "grad_weights: tensor([-2.8498e-02, -1.5864e-01, -8.7676e-02,  6.1397e-01, -4.1850e-02,\n",
      "        -1.3987e+00, -1.2671e+00, -3.8596e+00, -6.9797e-02, -1.1429e-04,\n",
      "        -3.1872e-01, -1.7781e+00, -2.9131e-02, -5.3523e-02, -3.2063e-01,\n",
      "        -7.0613e-03, -6.0791e-02, -2.8731e-01, -1.4377e-01, -2.2628e-02],\n",
      "       device='cuda:1')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "####Few Shot 940 | 993 ####, loss/acc = 0.17647900/0.9400000\n",
      "grad_weights: tensor([-2.8018e-02, -1.5580e-01, -8.6199e-02,  6.0446e-01, -4.1132e-02,\n",
      "        -1.3760e+00, -1.2402e+00, -3.7958e+00, -6.8152e-02, -1.1169e-04,\n",
      "        -3.1346e-01, -1.7470e+00, -2.8522e-02, -5.2564e-02, -3.1525e-01,\n",
      "        -6.9312e-03, -5.9663e-02, -2.8225e-01, -1.4122e-01, -2.2265e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.17636308/0.9400000\n",
      "grad_weights: tensor([-2.7540e-02, -1.5296e-01, -8.4732e-02,  5.9483e-01, -4.0420e-02,\n",
      "        -1.3533e+00, -1.2120e+00, -3.7320e+00, -6.6536e-02, -1.0909e-04,\n",
      "        -3.0816e-01, -1.7162e+00, -2.7912e-02, -5.1606e-02, -3.0989e-01,\n",
      "        -6.8020e-03, -5.8546e-02, -2.7721e-01, -1.3868e-01, -2.1904e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.17624909/0.9400000\n",
      "grad_weights: tensor([-2.7061e-02, -1.5014e-01, -8.3275e-02,  5.8517e-01, -3.9714e-02,\n",
      "        -1.3307e+00, -1.1859e+00, -3.6685e+00, -6.4950e-02, -1.0649e-04,\n",
      "        -3.0288e-01, -1.6856e+00, -2.7301e-02, -5.0654e-02, -3.0459e-01,\n",
      "        -6.6742e-03, -5.7439e-02, -2.7219e-01, -1.3616e-01, -2.1544e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.17613697/0.9400000\n",
      "grad_weights: tensor([-2.6585e-02, -1.4715e-01, -8.1818e-02,  5.7587e-01, -3.9005e-02,\n",
      "        -1.3073e+00, -1.1590e+00, -3.6040e+00, -6.3378e-02, -1.0379e-04,\n",
      "        -2.9763e-01, -1.6549e+00, -2.6668e-02, -4.9706e-02, -2.9903e-01,\n",
      "        -6.5412e-03, -5.6292e-02, -2.6721e-01, -1.3354e-01, -2.1185e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.17602681/0.9400000\n",
      "grad_weights: tensor([-2.6111e-02, -1.4437e-01, -8.0341e-02,  5.6549e-01, -3.8283e-02,\n",
      "        -1.2841e+00, -1.1328e+00, -3.5373e+00, -6.1808e-02, -1.0129e-04,\n",
      "        -2.9240e-01, -1.6237e+00, -2.6065e-02, -4.8729e-02, -2.9380e-01,\n",
      "        -6.4120e-03, -5.5209e-02, -2.6217e-01, -1.3107e-01, -2.0830e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.17591871/0.9400000\n",
      "grad_weights: tensor([-2.5638e-02, -1.4161e-01, -7.8924e-02,  5.5577e-01, -3.7598e-02,\n",
      "        -1.2621e+00, -1.1078e+00, -3.4744e+00, -6.0314e-02, -9.8744e-05,\n",
      "        -2.8720e-01, -1.5939e+00, -2.5466e-02, -4.7799e-02, -2.8862e-01,\n",
      "        -6.2877e-03, -5.4139e-02, -2.5725e-01, -1.2862e-01, -2.0478e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.17581251/0.9400000\n",
      "grad_weights: tensor([-2.5129e-02, -1.3867e-01, -7.7515e-02,  5.4608e-01, -3.6919e-02,\n",
      "        -1.2401e+00, -1.0822e+00, -3.4074e+00, -5.8849e-02, -9.6209e-05,\n",
      "        -2.8205e-01, -1.5628e+00, -2.4866e-02, -4.6878e-02, -2.8347e-01,\n",
      "        -6.1589e-03, -5.3082e-02, -2.5200e-01, -1.2619e-01, -2.0128e-02],\n",
      "       device='cuda:1')\n",
      "####Few Shot 940 | 993 ####, loss/acc = 0.17570844/0.9500000\n",
      "grad_weights: tensor([-2.4661e-02, -1.3595e-01, -7.6124e-02,  5.3635e-01, -3.6248e-02,\n",
      "        -1.2184e+00, -1.0580e+00, -3.3452e+00, -5.7414e-02, -9.3681e-05,\n",
      "        -2.7691e-01, -1.5337e+00, -2.4269e-02, -4.5965e-02, -2.7838e-01,\n",
      "        -6.0372e-03, -5.2037e-02, -2.4717e-01, -1.2378e-01, -1.9782e-02],\n",
      "       device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.4997, device='cuda:1'), 0.8, 0.7894736842105263)\n",
      "=====> Optimized weights: tensor([ 1.1146,  1.1141,  1.1147, -1.1152,  1.1146,  1.1149,  1.1127,  1.1148,\n",
      "         1.1118,  1.1020,  1.1148,  1.1144,  1.1127,  1.1142,  1.1147,  1.1138,\n",
      "         1.1140,  1.1143,  1.1143,  1.1151], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597, 377, 78, 823, 1027, 567, 604, 801, 171, 334, 20, 756, 380, 595, 342, 399, 724, 317, 944, 811, 193, 359, 814, 100, 982, 251, 862, 496, 364, 449, 278, 117, 63, 279, 2, 224, 417]\n",
      "=====> init acc: (tensor(0.5000, device='cuda:1'), 0.9, 0.75)\n",
      "=====> init weights: tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
      "       device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.17671619/0.9400000\n",
      "grad_weights: tensor([-1.2881, -2.7087, -0.4968, -0.0147, -0.1123, -0.0281, -0.0736, -2.9585,\n",
      "        -0.2643, -0.4344, -1.6157,  0.0727, -0.0159, -0.0252, -0.0161, -0.2867,\n",
      "         0.3410, -0.0619, -0.2284, -0.3583], device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.17666639/0.9400000\n",
      "grad_weights: tensor([-1.2742, -2.6875, -0.4922, -0.0146, -0.1112, -0.0279, -0.0730, -2.9335,\n",
      "        -0.2622, -0.4307, -1.6031,  0.0721, -0.0158, -0.0250, -0.0160, -0.2847,\n",
      "         0.3397, -0.0614, -0.2265, -0.3543], device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.17661692/0.9400000\n",
      "grad_weights: tensor([-1.2605, -2.6664, -0.4877, -0.0145, -0.1101, -0.0276, -0.0725, -2.9086,\n",
      "        -0.2602, -0.4271, -1.5905,  0.0715, -0.0156, -0.0248, -0.0159, -0.2826,\n",
      "         0.3384, -0.0609, -0.2246, -0.3504], device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.17656773/0.9400000\n",
      "grad_weights: tensor([-1.2469, -2.6453, -0.4831, -0.0144, -0.1090, -0.0274, -0.0720, -2.8839,\n",
      "        -0.2582, -0.4235, -1.5779,  0.0708, -0.0155, -0.0246, -0.0158, -0.2806,\n",
      "         0.3371, -0.0604, -0.2227, -0.3465], device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.17651884/0.9400000\n",
      "grad_weights: tensor([-1.2334, -2.6243, -0.4786, -0.0143, -0.1080, -0.0272, -0.0715, -2.8593,\n",
      "        -0.2561, -0.4199, -1.5652,  0.0702, -0.0154, -0.0245, -0.0157, -0.2785,\n",
      "         0.3358, -0.0599, -0.2209, -0.3426], device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.17647023/0.9400000\n",
      "grad_weights: tensor([-1.2200, -2.6035, -0.4742, -0.0142, -0.1069, -0.0270, -0.0709, -2.8349,\n",
      "        -0.2541, -0.4164, -1.5527,  0.0696, -0.0153, -0.0243, -0.0156, -0.2765,\n",
      "         0.3344, -0.0594, -0.2190, -0.3388], device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.17642197/0.9400000\n",
      "grad_weights: tensor([-1.2067, -2.5827, -0.4698, -0.0141, -0.1059, -0.0268, -0.0704, -2.8106,\n",
      "        -0.2521, -0.4129, -1.5401,  0.0690, -0.0152, -0.0241, -0.0155, -0.2745,\n",
      "         0.3331, -0.0589, -0.2172, -0.3350], device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.17637397/0.9400000\n",
      "grad_weights: tensor([-1.1936, -2.5620, -0.4654, -0.0140, -0.1048, -0.0266, -0.0699, -2.7865,\n",
      "        -0.2501, -0.4094, -1.5276,  0.0683, -0.0150, -0.0239, -0.0154, -0.2725,\n",
      "         0.3318, -0.0584, -0.2153, -0.3313], device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.17632639/0.9400000\n",
      "grad_weights: tensor([-1.1805, -2.5414, -0.4610, -0.0139, -0.1038, -0.0264, -0.0694, -2.7625,\n",
      "        -0.2481, -0.4059, -1.5150,  0.0677, -0.0149, -0.0237, -0.0153, -0.2705,\n",
      "         0.3304, -0.0579, -0.2135, -0.3275], device='cuda:1')\n",
      "####Few Shot 960 | 993 ####, loss/acc = 0.17627907/0.9400000\n",
      "grad_weights: tensor([-1.1677, -2.5211, -0.4567, -0.0138, -0.1028, -0.0262, -0.0689, -2.7388,\n",
      "        -0.2462, -0.4025, -1.5027,  0.0671, -0.0148, -0.0235, -0.0152, -0.2685,\n",
      "         0.3291, -0.0575, -0.2117, -0.3239], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.3001, device='cuda:1'), 1.0, 0.7222222222222222)\n",
      "=====> Optimized weights: tensor([ 0.4362,  0.4367,  0.4365,  0.4368,  0.4364,  0.4367,  0.4368,  0.4366,\n",
      "         0.4367,  0.4366,  0.4367, -0.4365,  0.4367,  0.4367,  0.4369,  0.4368,\n",
      "        -0.4373,  0.4366,  0.4366,  0.4362], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597, 377, 78, 823, 1027, 567, 604, 801, 171, 334, 20, 756, 380, 595, 342, 399, 724, 317, 944, 811, 193, 359, 814, 100, 982, 251, 862, 496, 364, 449, 278, 117, 63, 279, 2, 224, 417, 676, 723, 409, 466]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====> init acc: (tensor(0.1425, device='cuda:1'), 0.6, 0.6666666666666666)\n",
      "=====> init weights: tensor([ 0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000,\n",
      "         0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  1.1298,  1.1321,  1.1316,\n",
      "        -1.1361,  1.1315,  1.1318,  1.1321], device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.17642888/0.9400000\n",
      "grad_weights: tensor([-0.5823, -0.5942, -0.1240, -0.2494, -0.1261, -0.0098, -1.0532, -0.4271,\n",
      "        -0.0513, -0.1761, -0.4159, -0.3733, -0.7278, -0.3145, -0.0199, -0.0931,\n",
      "         0.7110, -0.0838, -1.2370, -0.0208], device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.17639896/0.9400000\n",
      "grad_weights: tensor([-0.5793, -0.5916, -0.1234, -0.2482, -0.1255, -0.0097, -1.0477, -0.4250,\n",
      "        -0.0511, -0.1752, -0.4141, -0.3712, -0.7233, -0.3127, -0.0198, -0.0927,\n",
      "         0.7094, -0.0834, -1.2312, -0.0207], device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.17636913/0.9400000\n",
      "grad_weights: tensor([-0.5763, -0.5890, -0.1229, -0.2469, -0.1250, -0.0097, -1.0421, -0.4230,\n",
      "        -0.0509, -0.1743, -0.4124, -0.3691, -0.7188, -0.3109, -0.0197, -0.0923,\n",
      "         0.7078, -0.0830, -1.2255, -0.0206], device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.17633945/0.9400000\n",
      "grad_weights: tensor([-0.5733, -0.5865, -0.1223, -0.2457, -0.1244, -0.0096, -1.0366, -0.4209,\n",
      "        -0.0507, -0.1734, -0.4106, -0.3671, -0.7144, -0.3092, -0.0196, -0.0918,\n",
      "         0.7062, -0.0826, -1.2198, -0.0205], device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.17630985/0.9400000\n",
      "grad_weights: tensor([-0.5704, -0.5840, -0.1217, -0.2444, -0.1239, -0.0096, -1.0311, -0.4189,\n",
      "        -0.0504, -0.1725, -0.4089, -0.3650, -0.7100, -0.3074, -0.0196, -0.0914,\n",
      "         0.7047, -0.0822, -1.2140, -0.0204], device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.17628036/0.9400000\n",
      "grad_weights: tensor([-0.5674, -0.5814, -0.1211, -0.2432, -0.1234, -0.0095, -1.0257, -0.4169,\n",
      "        -0.0502, -0.1716, -0.4071, -0.3630, -0.7056, -0.3057, -0.0195, -0.0910,\n",
      "         0.7031, -0.0817, -1.2083, -0.0203], device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.17625101/0.9400000\n",
      "grad_weights: tensor([-0.5645, -0.5789, -0.1205, -0.2418, -0.1227, -0.0095, -1.0202, -0.4145,\n",
      "        -0.0500, -0.1706, -0.4053, -0.3605, -0.7012, -0.3037, -0.0194, -0.0905,\n",
      "         0.7009, -0.0813, -1.2026, -0.0202], device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.17622177/0.9400000\n",
      "grad_weights: tensor([-0.5616, -0.5764, -0.1200, -0.2405, -0.1222, -0.0094, -1.0148, -0.4125,\n",
      "        -0.0497, -0.1697, -0.4036, -0.3585, -0.6968, -0.3019, -0.0193, -0.0901,\n",
      "         0.6993, -0.0809, -1.1969, -0.0202], device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.17619269/0.9400000\n",
      "grad_weights: tensor([-0.5585, -0.5737, -0.1194, -0.2392, -0.1216, -0.0094, -1.0093, -0.4104,\n",
      "        -0.0495, -0.1688, -0.4018, -0.3564, -0.6924, -0.3001, -0.0192, -0.0896,\n",
      "         0.6976, -0.0805, -1.1910, -0.0201], device='cuda:1')\n",
      "####Few Shot 980 | 993 ####, loss/acc = 0.17616369/0.9400000\n",
      "grad_weights: tensor([-0.5556, -0.5712, -0.1188, -0.2380, -0.1211, -0.0093, -1.0039, -0.4085,\n",
      "        -0.0493, -0.1680, -0.4000, -0.3544, -0.6881, -0.2984, -0.0191, -0.0892,\n",
      "         0.6959, -0.0801, -1.1853, -0.0200], device='cuda:1')\n",
      "=====> Optimized acc: (tensor(0.2217, device='cuda:1'), 0.7, 0.6842105263157895)\n",
      "=====> Optimized weights: tensor([ 0.4003,  0.4004,  0.4003,  0.4003,  0.4004,  0.4002,  0.4002,  0.4003,\n",
      "         0.4003,  0.4003,  0.4004,  0.4002,  0.4001,  1.5300,  1.5324,  1.5319,\n",
      "        -1.5368,  1.5318,  1.5321,  1.5325], device='cuda:1')\n",
      "valid_idxs: [689, 715, 645, 444, 854, 858, 976, 350, 511, 808, 535, 269, 348, 764, 959, 618, 651, 953, 430, 273, 614, 196, 232, 898, 861, 520, 147, 857, 769, 725, 1040, 613, 146, 276, 468, 591, 728, 479, 757, 282, 457, 420, 189, 1014, 249, 652, 145, 716, 635, 946, 783, 123, 93, 335, 1019, 762, 97, 478, 473, 305, 508, 476, 1016, 272, 354, 1018, 412, 421, 602, 336, 621, 176, 155, 708, 732, 552, 160, 108, 949, 852, 867, 888, 759, 490, 137, 1035, 124, 740, 266, 659, 162, 677, 611, 1021, 403, 290, 829, 387, 819, 824, 566, 766, 219, 289, 743, 747, 386, 720, 910, 760, 452, 972, 304, 416, 57, 134, 787, 786, 846, 87, 361, 344, 390, 169, 1009, 710, 818, 571, 623, 11, 293, 545, 544, 642, 70, 686, 185, 1002, 199, 827, 692, 222, 143, 933, 909, 779, 537, 247, 960, 101, 643, 349, 46, 964, 507, 597, 377, 78, 823, 1027, 567, 604, 801, 171, 334, 20, 756, 380, 595, 342, 399, 724, 317, 944, 811, 193, 359, 814, 100, 982, 251, 862, 496, 364, 449, 278, 117, 63, 279, 2, 224, 417, 676, 723, 409, 466, 297, 744, 880, 689]\n",
      "reset tmp model\n",
      "%3d | %3d Post-MetaTrain Performance of model1: (0.775647171620326, (array([0.8042328, 0.5      ]), array([0.9394314 , 0.20940171]), array([0.86659065, 0.29518072]), array([809, 234])))\n",
      "###Accuracy On selected instancees (0.745, (array([0.745, 0.   ]), array([1., 0.]), array([0.85386819, 0.        ]), array([149,  51])))\n",
      "###Accuracy On pseaudo instances (0.92, (array([0.92, 0.  ]), array([1., 0.]), array([0.95833333, 0.        ]), array([46,  4])))\n",
      "###Accuracy On training instances (0.78, (array([0.78, 0.  ]), array([1., 0.]), array([0.87640449, 0.        ]), array([195,  55])))\n",
      "==================Global Data Selection===============>\n",
      "###Accuracy On selected instancees (0.8028846153846154, (array([0.80288462, 0.        ]), array([1., 0.]), array([0.89066667, 0.        ]), array([167,  41])))\n",
      "###Accuracy On pseaudo instances (0.92, (array([0.92, 0.  ]), array([1., 0.]), array([0.95833333, 0.        ]), array([46,  4])))\n",
      "###Accuracy On training instances (0.8255813953488372, (array([0.8255814, 0.       ]), array([1., 0.]), array([0.9044586, 0.       ]), array([213,  45])))\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hadoop/.conda/envs/torch_B/lib/python3.6/site-packages/sklearn/metrics/classification.py:1437: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n"
     ]
    }
   ],
   "source": [
    "    entrophy, preds, logits = WeakLabeling(anno_model, weak_set, pseaudo_idxs=p_idxs + e_idxs)\n",
    "    idxs = expandPseaudoSet(tr_model, anno_model, weak_set, p_idxs + e_idxs, threshold=0.95)\n",
    "    p_idxs.extend(idxs)\n",
    "    trainer = MetaSelfTrainer(tr_model, weak_set, f_set, weak_set_label,\n",
    "                                 exp_idxs=e_idxs, convey_fn=None, lr4model=5e-2,\n",
    "                                   scale_lr4model=4e-2, max_few_shot_size=100, batch_size=20)\n",
    "    max_meta_steps = 10\n",
    "    if len(e_idxs)>100:\n",
    "        print(\"expand_idxs length:\", len(e_idxs))\n",
    "        trainer.ConstructExpandData(batch_size=100)\n",
    "        max_meta_steps = 5\n",
    "    # valid_idxs = trainer.BalancedTraining(entrophy, max_epoch=10, batch_size=32,\n",
    "    #                                             max_meta_steps=max_meta_steps,\n",
    "    #                                                 lr4weights=0.1, meta_lr4model=2e-2,\n",
    "    #                                                     meta_scale_lr4model=2e-3,\n",
    "    #                                                         pseaudo_idxs=p_idxs)\n",
    "    tmp = (trainer.lr4model, trainer.scale_lr4model)\n",
    "    trainer.lr4model, trainer.scale_lr4model = 2e-1, 1e-4\n",
    "    valid_idxs = trainer.PopOut(max_epochs=1, max_meta_steps=max_meta_steps,\n",
    "                                    lr4weights=0.02, pseaudo_idxs=pseaudo_idxs,\n",
    "                                        pop_ratio=0.2) # ferguson 上是0.1, sydney上是0.05\n",
    "    trainer.lr4model, trainer.scale_lr4model = tmp[0], tmp[1]\n",
    "    rst_model1 = Perf(tr_model, weak_set, weak_set_label)\n",
    "    print(\"%3d | %3d Post-MetaTrain Performance of model1:\", rst_model1)\n",
    "    pseaudo_labels = torch.tensor(weak_set.data_y).argmax(dim=1)\n",
    "    rst_s = acc_P_R_F1(weak_set_label[valid_idxs],\n",
    "                    pseaudo_labels[valid_idxs])\n",
    "    print(\"###Accuracy On selected instancees\", rst_s)\n",
    "    rst_p = acc_P_R_F1(weak_set_label[p_idxs],\n",
    "                       pseaudo_labels[p_idxs])\n",
    "    print(\"###Accuracy On pseaudo instances\", rst_p)\n",
    "    rst_t = acc_P_R_F1(weak_set_label[p_idxs + valid_idxs],\n",
    "                       pseaudo_labels[p_idxs + valid_idxs])\n",
    "    print(\"###Accuracy On training instances\", rst_t)\n",
    "\n",
    "    print(\"==================Global Data Selection===============>\")\n",
    "    valid_cnt = len(trainer.weak_set_weights)//5\n",
    "    valid_idxs = trainer.weak_set_weights.argsort()[-valid_cnt:].tolist()\n",
    "    rst_s = acc_P_R_F1(weak_set_label[valid_idxs],\n",
    "                       pseaudo_labels[valid_idxs])\n",
    "    print(\"###Accuracy On selected instancees\", rst_s)\n",
    "    rst_p = acc_P_R_F1(weak_set_label[p_idxs],\n",
    "                       pseaudo_labels[p_idxs])\n",
    "    print(\"###Accuracy On pseaudo instances\", rst_p)\n",
    "    rst_t = acc_P_R_F1(weak_set_label[p_idxs + valid_idxs],\n",
    "                       pseaudo_labels[p_idxs + valid_idxs])\n",
    "    print(\"###Accuracy On training instances\", rst_t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
